Changeset 4110 for trunk/LMDZ.COMMON/libf/evolution/io_netcdf.F90
- Timestamp:
- Mar 9, 2026, 10:29:53 AM (4 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/io_netcdf.F90 (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/io_netcdf.F90
r4090 r4110 32 32 character(11), parameter :: start1D_name = 'start1D.txt' 33 33 character(10), parameter :: startfi_name = 'startfi.nc' 34 character(1 2), parameter :: startpem_name = 'startevol.nc'34 character(11), parameter :: startpem_name = 'startevo.nc' 35 35 character(19), parameter :: xios_day_name1 = 'Xoutdaily4pem_Y1.nc' ! XIOS daily output file, second to last PCM year 36 36 character(19), parameter :: xios_day_name2 = 'Xoutdaily4pem_Y2.nc' ! XIOS daily output file, last PCM year 37 37 character(20), parameter :: xios_yr_name1 = 'Xoutyearly4pem_Y1.nc' ! XIOS yearly output file, second to last PCM year 38 38 character(20), parameter :: xios_yr_name2 = 'Xoutyearly4pem_Y2.nc' ! XIOS yearly output file, last PCM year 39 character(1 1), parameter :: diagevol_name = 'diagevol.nc'39 character(10), parameter :: diagevo_name = 'diagevo.nc' 40 40 41 41 ! VARIABLES 42 42 ! --------- 43 logical(k4), pr ivate :: open_ncfile = .false.! Flag to true if a NetCDF file is already open44 logical(k4), pr ivate :: open_diagevol = .false. ! Flag to true if "diagevol.nc" is already open45 integer(di), pr ivate :: ncid_file! File ID46 integer(di), pr ivate :: varid! Variable ID47 integer(di) :: ncid_diagevo l ! File ID specific to "diagevol.nc"43 logical(k4), protected, private :: open_ncfile = .false. ! Flag to true if a NetCDF file is already open 44 logical(k4), protected, private :: open_diagevo = .false. ! Flag to true if "diagevo.nc" is already open 45 integer(di), protected, private :: ncid_file ! File ID 46 integer(di), protected, private :: varid ! Variable ID 47 integer(di) :: ncid_diagevo ! File ID specific to "diagevo.nc" 48 48 49 49 ! INTERFACES … … 82 82 ! DEPENDENCIES 83 83 ! ------------ 84 use display, only: print_ err84 use display, only: print_msg, LVL_ERR 85 85 86 86 ! ARGUMENTS … … 106 106 else 107 107 if (.not. tmp_found) then 108 call print_ err(trim(nf90_strerror(ierr)))108 call print_msg(trim(nf90_strerror(ierr)),LVL_ERR) 109 109 call stop_clean(__FILE__,__LINE__,'NetCDF error when '//trim(msg),ierr) 110 110 end if … … 142 142 ! ---- 143 143 ! Diagevol logic 144 if (adjustl(trim(filename)) == diagevo l_name) then144 if (adjustl(trim(filename)) == diagevo_name) then 145 145 if (adjustl(trim(mode)) == 'read') then 146 146 call stop_clean(__FILE__,__LINE__,'opening mode "read" cannot be used with '//trim(filename)//'"!',1) 147 147 else if (adjustl(trim(mode)) == 'write') then 148 if (.not. open_diagevo l) then149 call check_nc(nf90_open(trim(filename),nf90_write,ncid_diagevo l),'opening file '//trim(filename)//' to write')148 if (.not. open_diagevo) then 149 call check_nc(nf90_open(trim(filename),nf90_write,ncid_diagevo),'opening file '//trim(filename)//' to write') 150 150 if (present(itime)) call get_next_itime_nc('Time',itime) ! Next time index 151 open_diagevo l= .true.151 open_diagevo = .true. 152 152 end if 153 153 return … … 201 201 ! CODE 202 202 ! ---- 203 if (adjustl(trim(filename)) == diagevo l_name) then ! Diagevol logic204 call check_nc(nf90_close(ncid_diagevo l),'closing file '//trim(filename))205 open_diagevo l= .false.203 if (adjustl(trim(filename)) == diagevo_name) then ! Diagevol logic 204 call check_nc(nf90_close(ncid_diagevo),'closing file '//trim(filename)) 205 open_diagevo = .false. 206 206 else ! Standard logic 207 207 call check_nc(nf90_close(ncid_file),'closing file '//trim(filename)) … … 288 288 ! ---- 289 289 ! Diagevol logic priority over standard logic 290 if (open_diagevo l) then291 ncid = ncid_diagevo l290 if (open_diagevo) then 291 ncid = ncid_diagevo 292 292 else 293 293 ncid = ncid_file … … 547 547 ! ---- 548 548 ! Diagevol logic priority over standard logic 549 if (open_diagevo l) then550 ncid = ncid_diagevo l549 if (open_diagevo) then 550 ncid = ncid_diagevo 551 551 else 552 552 ncid = ncid_file … … 611 611 ! ---- 612 612 ! Diagevol logic priority over standard logic 613 if (open_diagevo l) then614 ncid = ncid_diagevo l613 if (open_diagevo) then 614 ncid = ncid_diagevo 615 615 else 616 616 ncid = ncid_file … … 682 682 ! ---- 683 683 ! Diagevol logic priority over standard logic 684 if (open_diagevo l) then685 ncid = ncid_diagevo l684 if (open_diagevo) then 685 ncid = ncid_diagevo 686 686 else 687 687 ncid = ncid_file … … 753 753 ! ---- 754 754 ! Diagevol logic priority over standard logic 755 if (open_diagevo l) then756 ncid = ncid_diagevo l755 if (open_diagevo) then 756 ncid = ncid_diagevo 757 757 else 758 758 ncid = ncid_file … … 824 824 ! ---- 825 825 ! Diagevol logic priority over standard logic 826 if (open_diagevo l) then827 ncid = ncid_diagevo l826 if (open_diagevo) then 827 ncid = ncid_diagevo 828 828 else 829 829 ncid = ncid_file … … 942 942 ! ---- 943 943 ! Diagevol logic priority over standard logic 944 if (open_diagevo l) then945 ncid = ncid_diagevo l944 if (open_diagevo) then 945 ncid = ncid_diagevo 946 946 else 947 947 ncid = ncid_file … … 1027 1027 ! ---- 1028 1028 ! Diagevol logic priority over standard logic 1029 if (open_diagevo l) then1030 ncid = ncid_diagevo l1029 if (open_diagevo) then 1030 ncid = ncid_diagevo 1031 1031 else 1032 1032 ncid = ncid_file … … 1112 1112 ! ---- 1113 1113 ! Diagevol logic priority over standard logic 1114 if (open_diagevo l) then1115 ncid = ncid_diagevo l1114 if (open_diagevo) then 1115 ncid = ncid_diagevo 1116 1116 else 1117 1117 ncid = ncid_file … … 1197 1197 ! ---- 1198 1198 ! Diagevol logic priority over standard logic 1199 if (open_diagevo l) then1200 ncid = ncid_diagevo l1199 if (open_diagevo) then 1200 ncid = ncid_diagevo 1201 1201 else 1202 1202 ncid = ncid_file … … 1282 1282 ! ---- 1283 1283 ! Diagevol logic priority over standard logic 1284 if (open_diagevo l) then1285 ncid = ncid_diagevo l1284 if (open_diagevo) then 1285 ncid = ncid_diagevo 1286 1286 else 1287 1287 ncid = ncid_file
Note: See TracChangeset
for help on using the changeset viewer.
