Ignore:
Timestamp:
Mar 6, 2016 6:36:17 PM (6 years ago)
Author:
raasch
Message:

NetCDF routines modularized; new parameter netcdf_deflate; further changes in the pmc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • palm/trunk/SOURCE/check_open.f90

    r1780 r1783  
    1919! Current revisions:
    2020! -----------------
    21 !
     21! name change of netcdf routines and module + related changes
    2222!
    2323! Former revisions:
     
    106106    USE control_parameters,                                                    &
    107107        ONLY:  avs_data_file, coupling_char, data_output_2d_on_each_pe, host,  &
    108                message_string, mid, netcdf_data_format, nz_do3d, openfile,     &
     108               max_masks, message_string, mid, nz_do3d, openfile,              &
    109109               return_addres, return_username, run_description_header, runnr
    110110
     
    117117    USE kinds
    118118
    119     USE netcdf_control
     119#if defined( __netcdf )
     120    USE NETCDF
     121#endif
     122
     123    USE netcdf_interface,                                                      &
     124        ONLY:  id_set_mask, id_set_pr, id_set_prt, id_set_pts, id_set_sp,      &
     125               id_set_ts, id_set_xy, id_set_xz, id_set_yz, id_set_3d, nc_stat, &
     126               netcdf_create_file, netcdf_data_format, netcdf_define_header,   &
     127               netcdf_handle_error, netcdf_open_write_file
    120128
    121129    USE particle_attributes,                                                   &
     
    649657!
    650658!--          Open an existing netCDF file for output
    651              CALL open_write_netcdf_file( filename, id_set_xy(av), .TRUE., 20 )
     659             CALL netcdf_open_write_file( filename, id_set_xy(av), .TRUE., 20 )
    652660!
    653661!--          Read header information and set all ids. If there is a mismatch
    654662!--          between the previuos and the actual run, netcdf_extend is returned
    655663!--          as .FALSE.
    656              CALL define_netcdf_header( 'xy', netcdf_extend, av )
     664             CALL netcdf_define_header( 'xy', netcdf_extend, av )
    657665
    658666!
     
    660668             IF ( .NOT. netcdf_extend )  THEN
    661669                nc_stat = NF90_CLOSE( id_set_xy(av) )
    662                 CALL handle_netcdf_error( 'check_open', 21 )
     670                CALL netcdf_handle_error( 'check_open', 21 )
    663671                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
    664672#if defined( __parallel ) && ! defined ( __check )
     
    675683!
    676684!--          Create a new netCDF output file with requested netCDF format
    677              CALL create_netcdf_file( filename, id_set_xy(av), .TRUE., 22 )
     685             CALL netcdf_create_file( filename, id_set_xy(av), .TRUE., 22 )
    678686
    679687!
    680688!--          Define the header
    681              CALL define_netcdf_header( 'xy', netcdf_extend, av )
     689             CALL netcdf_define_header( 'xy', netcdf_extend, av )
    682690
    683691!
     
    711719!
    712720!--          Open an existing netCDF file for output
    713              CALL open_write_netcdf_file( filename, id_set_xz(av), .TRUE., 23 )
     721             CALL netcdf_open_write_file( filename, id_set_xz(av), .TRUE., 23 )
    714722!
    715723!--          Read header information and set all ids. If there is a mismatch
    716724!--          between the previuos and the actual run, netcdf_extend is returned
    717725!--          as .FALSE.
    718              CALL define_netcdf_header( 'xz', netcdf_extend, av )
     726             CALL netcdf_define_header( 'xz', netcdf_extend, av )
    719727
    720728!
     
    722730             IF ( .NOT. netcdf_extend )  THEN
    723731                nc_stat = NF90_CLOSE( id_set_xz(av) )
    724                 CALL handle_netcdf_error( 'check_open', 24 )
     732                CALL netcdf_handle_error( 'check_open', 24 )
    725733                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
    726734#if defined( __parallel ) && ! defined ( __check )
     
    737745!
    738746!--          Create a new netCDF output file with requested netCDF format
    739              CALL create_netcdf_file( filename, id_set_xz(av), .TRUE., 25 )
     747             CALL netcdf_create_file( filename, id_set_xz(av), .TRUE., 25 )
    740748
    741749!
    742750!--          Define the header
    743              CALL define_netcdf_header( 'xz', netcdf_extend, av )
     751             CALL netcdf_define_header( 'xz', netcdf_extend, av )
    744752
    745753!
     
    773781!
    774782!--          Open an existing netCDF file for output
    775              CALL open_write_netcdf_file( filename, id_set_yz(av), .TRUE., 26 )
     783             CALL netcdf_open_write_file( filename, id_set_yz(av), .TRUE., 26 )
    776784!
    777785!--          Read header information and set all ids. If there is a mismatch
    778786!--          between the previuos and the actual run, netcdf_extend is returned
    779787!--          as .FALSE.
    780              CALL define_netcdf_header( 'yz', netcdf_extend, av )
     788             CALL netcdf_define_header( 'yz', netcdf_extend, av )
    781789
    782790!
     
    784792             IF ( .NOT. netcdf_extend )  THEN
    785793                nc_stat = NF90_CLOSE( id_set_yz(av) )
    786                 CALL handle_netcdf_error( 'check_open', 27 )
     794                CALL netcdf_handle_error( 'check_open', 27 )
    787795                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
    788796#if defined( __parallel ) && ! defined ( __check )
     
    799807!
    800808!--          Create a new netCDF output file with requested netCDF format
    801              CALL create_netcdf_file( filename, id_set_yz(av), .TRUE., 28 )
     809             CALL netcdf_create_file( filename, id_set_yz(av), .TRUE., 28 )
    802810
    803811!
    804812!--          Define the header
    805              CALL define_netcdf_header( 'yz', netcdf_extend, av )
     813             CALL netcdf_define_header( 'yz', netcdf_extend, av )
    806814
    807815!
     
    829837!
    830838!--          Open an existing netCDF file for output
    831              CALL open_write_netcdf_file( filename, id_set_pr, .FALSE., 29 )
     839             CALL netcdf_open_write_file( filename, id_set_pr, .FALSE., 29 )
    832840!
    833841!--          Read header information and set all ids. If there is a mismatch
    834842!--          between the previuos and the actual run, netcdf_extend is returned
    835843!--          as .FALSE.
    836              CALL define_netcdf_header( 'pr', netcdf_extend, 0 )
     844             CALL netcdf_define_header( 'pr', netcdf_extend, 0 )
    837845
    838846!
     
    840848             IF ( .NOT. netcdf_extend )  THEN
    841849                nc_stat = NF90_CLOSE( id_set_pr )
    842                 CALL handle_netcdf_error( 'check_open', 30 )
     850                CALL netcdf_handle_error( 'check_open', 30 )
    843851                CALL local_system( 'rm ' // TRIM( filename ) )
    844852             ENDIF
     
    849857!
    850858!--          Create a new netCDF output file with requested netCDF format
    851              CALL create_netcdf_file( filename, id_set_pr, .FALSE., 31 )
     859             CALL netcdf_create_file( filename, id_set_pr, .FALSE., 31 )
    852860!
    853861!--          Define the header
    854              CALL define_netcdf_header( 'pr', netcdf_extend, 0 )
     862             CALL netcdf_define_header( 'pr', netcdf_extend, 0 )
    855863
    856864          ENDIF
     
    869877!
    870878!--          Open an existing netCDF file for output
    871              CALL open_write_netcdf_file( filename, id_set_ts, .FALSE., 32 )
     879             CALL netcdf_open_write_file( filename, id_set_ts, .FALSE., 32 )
    872880!
    873881!--          Read header information and set all ids. If there is a mismatch
    874882!--          between the previuos and the actual run, netcdf_extend is returned
    875883!--          as .FALSE.
    876              CALL define_netcdf_header( 'ts', netcdf_extend, 0 )
     884             CALL netcdf_define_header( 'ts', netcdf_extend, 0 )
    877885
    878886!
     
    880888             IF ( .NOT. netcdf_extend )  THEN
    881889                nc_stat = NF90_CLOSE( id_set_ts )
    882                 CALL handle_netcdf_error( 'check_open', 33 )
     890                CALL netcdf_handle_error( 'check_open', 33 )
    883891                CALL local_system( 'rm ' // TRIM( filename ) )
    884892             ENDIF
     
    889897!
    890898!--          Create a new netCDF output file with requested netCDF format
    891              CALL create_netcdf_file( filename, id_set_ts, .FALSE., 34 )
     899             CALL netcdf_create_file( filename, id_set_ts, .FALSE., 34 )
    892900!
    893901!--          Define the header
    894              CALL define_netcdf_header( 'ts', netcdf_extend, 0 )
     902             CALL netcdf_define_header( 'ts', netcdf_extend, 0 )
    895903
    896904          ENDIF
     
    916924!
    917925!--          Open an existing netCDF file for output
    918              CALL open_write_netcdf_file( filename, id_set_3d(av), .TRUE., 35 )
     926             CALL netcdf_open_write_file( filename, id_set_3d(av), .TRUE., 35 )
    919927!
    920928!--          Read header information and set all ids. If there is a mismatch
    921929!--          between the previuos and the actual run, netcdf_extend is returned
    922930!--          as .FALSE.
    923              CALL define_netcdf_header( '3d', netcdf_extend, av )
     931             CALL netcdf_define_header( '3d', netcdf_extend, av )
    924932
    925933!
     
    927935             IF ( .NOT. netcdf_extend )  THEN
    928936                nc_stat = NF90_CLOSE( id_set_3d(av) )
    929                 CALL handle_netcdf_error( 'check_open', 36 )
     937                CALL netcdf_handle_error( 'check_open', 36 )
    930938                IF ( myid == 0 )  CALL local_system( 'rm ' // TRIM( filename ) )
    931939#if defined( __parallel ) && ! defined ( __check )
     
    943951!
    944952!--          Create a new netCDF output file with requested netCDF format
    945              CALL create_netcdf_file( filename, id_set_3d(av), .TRUE., 37 )
     953             CALL netcdf_create_file( filename, id_set_3d(av), .TRUE., 37 )
    946954
    947955!
    948956!--          Define the header
    949              CALL define_netcdf_header( '3d', netcdf_extend, av )
     957             CALL netcdf_define_header( '3d', netcdf_extend, av )
    950958
    951959!
     
    974982!
    975983!--          Open an existing netCDF file for output
    976              CALL open_write_netcdf_file( filename, id_set_sp, .FALSE., 38 )
     984             CALL netcdf_open_write_file( filename, id_set_sp, .FALSE., 38 )
    977985
    978986!
     
    980988!--          between the previuos and the actual run, netcdf_extend is returned
    981989!--          as .FALSE.
    982              CALL define_netcdf_header( 'sp', netcdf_extend, 0 )
     990             CALL netcdf_define_header( 'sp', netcdf_extend, 0 )
    983991
    984992!
     
    986994             IF ( .NOT. netcdf_extend )  THEN
    987995                nc_stat = NF90_CLOSE( id_set_sp )
    988                 CALL handle_netcdf_error( 'check_open', 39 )
     996                CALL netcdf_handle_error( 'check_open', 39 )
    989997                CALL local_system( 'rm ' // TRIM( filename ) )
    990998             ENDIF
     
    9951003!
    9961004!--          Create a new netCDF output file with requested netCDF format
    997              CALL create_netcdf_file( filename, id_set_sp, .FALSE., 40 )
     1005             CALL netcdf_create_file( filename, id_set_sp, .FALSE., 40 )
    9981006!
    9991007!--          Define the header
    1000              CALL define_netcdf_header( 'sp', netcdf_extend, 0 )
     1008             CALL netcdf_define_header( 'sp', netcdf_extend, 0 )
    10011009
    10021010          ENDIF
     
    10191027!
    10201028!--          Open an existing netCDF file for output
    1021              CALL open_write_netcdf_file( filename, id_set_prt, .FALSE., 41 )
     1029             CALL netcdf_open_write_file( filename, id_set_prt, .FALSE., 41 )
    10221030!
    10231031!--          Read header information and set all ids. If there is a mismatch
    10241032!--          between the previuos and the actual run, netcdf_extend is returned
    10251033!--          as .FALSE.
    1026              CALL define_netcdf_header( 'pt', netcdf_extend, 0 )
     1034             CALL netcdf_define_header( 'pt', netcdf_extend, 0 )
    10271035
    10281036!
     
    10301038             IF ( .NOT. netcdf_extend )  THEN
    10311039                nc_stat = NF90_CLOSE( id_set_prt )
    1032                 CALL handle_netcdf_error( 'check_open', 42 )
     1040                CALL netcdf_handle_error( 'check_open', 42 )
    10331041                CALL local_system( 'rm ' // TRIM( filename ) )
    10341042             ENDIF
     
    10561064!
    10571065!--          Create a new netCDF output file with requested netCDF format
    1058              CALL create_netcdf_file( filename, id_set_prt, .FALSE., 43 )
     1066             CALL netcdf_create_file( filename, id_set_prt, .FALSE., 43 )
    10591067
    10601068!
    10611069!--          Define the header
    1062              CALL define_netcdf_header( 'pt', netcdf_extend, 0 )
     1070             CALL netcdf_define_header( 'pt', netcdf_extend, 0 )
    10631071
    10641072          ENDIF
     
    10771085!
    10781086!--          Open an existing netCDF file for output
    1079              CALL open_write_netcdf_file( filename, id_set_pts, .FALSE., 393 )
     1087             CALL netcdf_open_write_file( filename, id_set_pts, .FALSE., 393 )
    10801088!
    10811089!--          Read header information and set all ids. If there is a mismatch
    10821090!--          between the previuos and the actual run, netcdf_extend is returned
    10831091!--          as .FALSE.
    1084              CALL define_netcdf_header( 'ps', netcdf_extend, 0 )
     1092             CALL netcdf_define_header( 'ps', netcdf_extend, 0 )
    10851093
    10861094!
     
    10881096             IF ( .NOT. netcdf_extend )  THEN
    10891097                nc_stat = NF90_CLOSE( id_set_pts )
    1090                 CALL handle_netcdf_error( 'check_open', 394 )
     1098                CALL netcdf_handle_error( 'check_open', 394 )
    10911099                CALL local_system( 'rm ' // TRIM( filename ) )
    10921100             ENDIF
     
    10971105!
    10981106!--          Create a new netCDF output file with requested netCDF format
    1099              CALL create_netcdf_file( filename, id_set_pts, .FALSE., 395 )
     1107             CALL netcdf_create_file( filename, id_set_pts, .FALSE., 395 )
    11001108!
    11011109!--          Define the header
    1102              CALL define_netcdf_header( 'ps', netcdf_extend, 0 )
     1110             CALL netcdf_define_header( 'ps', netcdf_extend, 0 )
    11031111
    11041112          ENDIF
     
    11381146!
    11391147!--          Open an existing netCDF file for output
    1140              CALL open_write_netcdf_file( filename, id_set_mask(mid,av),       &
     1148             CALL netcdf_open_write_file( filename, id_set_mask(mid,av),       &
    11411149                                          .TRUE., 456 )
    11421150!
     
    11441152!--          between the previuos and the actual run, netcdf_extend is returned
    11451153!--          as .FALSE.
    1146              CALL define_netcdf_header( 'ma', netcdf_extend, file_id )
     1154             CALL netcdf_define_header( 'ma', netcdf_extend, file_id )
    11471155
    11481156!
     
    11501158             IF ( .NOT. netcdf_extend )  THEN
    11511159                nc_stat = NF90_CLOSE( id_set_mask(mid,av) )
    1152                 CALL handle_netcdf_error( 'check_open', 457 )
     1160                CALL netcdf_handle_error( 'check_open', 457 )
    11531161                CALL local_system('rm ' // TRIM( filename ) )
    11541162             ENDIF
     
    11591167!
    11601168!--          Create a new netCDF output file with requested netCDF format
    1161              CALL create_netcdf_file( filename, id_set_mask(mid,av), .TRUE., 458 )
     1169             CALL netcdf_create_file( filename, id_set_mask(mid,av), .TRUE., 458 )
    11621170!
    11631171!--          Define the header
    1164              CALL define_netcdf_header( 'ma', netcdf_extend, file_id )
     1172             CALL netcdf_define_header( 'ma', netcdf_extend, file_id )
    11651173
    11661174          ENDIF
Note: See TracChangeset for help on using the changeset viewer.