Changeset 4027 for trunk/LMDZ.PLUTO
- Timestamp:
- Jan 20, 2026, 10:46:15 AM (2 days ago)
- Location:
- trunk/LMDZ.PLUTO/libf
- Files:
-
- 6 edited
-
muphypluto/mp2m_clouds.F90 (modified) (1 diff)
-
phypluto/inifis_mod.F90 (modified) (2 diffs)
-
phypluto/time_phylmdz_mod.F90 (modified) (1 diff)
-
phypluto/writediagfi.F (modified) (7 diffs)
-
phypluto/writediagspecIR.F (modified) (3 diffs)
-
phypluto/writediagspecVI.F (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.PLUTO/libf/muphypluto/mp2m_clouds.F90
r3957 r4027 360 360 ! Saturation ratio: 361 361 !~~~~~~~~~~~~~~~~~~ 362 where ((z_Xvap / qsat) > 1e 5)363 Xsat = 1e 5362 where ((z_Xvap / qsat) > 1e8) 363 Xsat = 1e8 364 364 elsewhere 365 365 Xsat = z_Xvap / qsat -
trunk/LMDZ.PLUTO/libf/phypluto/inifis_mod.F90
r3973 r4027 18 18 use comgeomfi_h, only: totarea, totarea_planet 19 19 use comsoil_h, only: ini_comsoil_h, nsoilmx, lay1_soil, alpha_soil 20 use time_phylmdz_mod, only: diagfi_output_rate,startfi_output_rate, &20 use time_phylmdz_mod, only: diagfi_output_rate,startfi_output_rate,slow_diagfi, & 21 21 init_time, daysec, dtphys 22 22 use comcstfi_mod, only: rad, cpp, g, r, rcp, & … … 185 185 diagfi_output_rate 186 186 187 if ((is_master).and.(ngrid.eq.1)) write(*,*) trim(rname)//& 188 ": Open/close diagfi.nc at output rate (rather than once) ?" 189 slow_diagfi =.false. ! default value, open/close diagfi once (1D only) 190 call getin_p("slow_diagfi",slow_diagfi) ! if true, open/close the diagfi.nc 191 ! at output frequency instead of once 192 ! (slower but required for debug) 193 if ((is_master).and.(ngrid.eq.1)) write(*,*) trim(rname)//& 194 ": slow_diagfi = ", slow_diagfi 195 187 196 if (is_master) write(*,*) trim(rname)//& 188 197 ": Output rate for start/startfi.nc files (in physics steps) ?" -
trunk/LMDZ.PLUTO/libf/phypluto/time_phylmdz_mod.F90
r3765 r4027 14 14 INTEGER,SAVE :: startfi_output_rate ! mainly for debugging 15 15 !$OMP THREADPRIVATE(diagfi_output_rate,startfi_output_rate) 16 17 LOGICAL,SAVE :: slow_diagfi ! to handle wether the netcdf file is 18 ! opened/close once or at output frequency 19 !$OMP THREADPRIVATE(slow_diagfi) 16 20 17 21 CONTAINS -
trunk/LMDZ.PLUTO/libf/phypluto/writediagfi.F
r3749 r4027 42 42 use geometry_mod, only: cell_area 43 43 use time_phylmdz_mod, only: diagfi_output_rate,dtphys,daysec 44 use time_phylmdz_mod, only: day_ini 44 use time_phylmdz_mod, only: day_ini, nday, slow_diagfi 45 45 USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root, 46 46 & is_master, gather … … 79 79 80 80 integer,save :: zitau=0 81 character(len=40),save :: firstnom='1234567890' 82 !$OMP THREADPRIVATE(zitau,firstnom) 81 integer,save :: lastzitau=0 82 character(len=27),save :: firstnom='1234567890' 83 character(len=27),save :: prevnom='1234567890' 84 character(len=27),save :: lastnom='1234567890' 85 !$OMP THREADPRIVATE(zitau,lastzitau,firstnom,prevnom,lastnom) 83 86 84 87 ! Ajouts … … 86 89 !$OMP THREADPRIVATE(ntime) 87 90 integer :: idim,varid 88 integer :: nid 91 integer, save :: nid 92 !$OMP THREADPRIVATE(nid) 89 93 character(len=*),parameter :: fichnom="diagfi.nc" 90 94 integer, dimension(4) :: id … … 132 136 IF (firstcall) THEN 133 137 firstcall=.false. 138 139 ! Compute the lastzitau (i.e. last timestep-1) 140 lastzitau=nday*nint(daysec/dtphys)-1 141 if (MOD(lastzitau+1,diagfi_output_rate).ne.0.) then 142 ! If so, output rate is less than once per sol 143 ! We must adjust zitau to 144 lastzitau=lastzitau-MOD(lastzitau+1,diagfi_output_rate) 145 endif 134 146 135 147 !$OMP MASTER … … 256 268 ENDIF 257 269 270 ierr= NF_CLOSE(nid) ! Close the NETCDF file once initialized 271 258 272 endif ! of if (is_master) 259 273 260 else261 262 if (is_master) then263 ! only the master is required to do this264 265 ! Open the NetCDF file266 ierr = NF_OPEN(fichnom,NF_WRITE,nid)267 endif ! of if (is_master)268 269 274 endif ! if (firstnom.eq.'1234567890') 275 276 ! Find lastnom 277 if (lastnom.eq.'1234567890') then 278 if (nom.eq.firstnom) then 279 if (prevnom.ne.'1234567890') then 280 lastnom=prevnom 281 endif 282 endif 283 prevnom=nom 284 endif 270 285 271 286 ! Increment time index 'zitau' if it is the "fist call" (at given time level) … … 288 303 289 304 if (is_master) then 290 ! only the master is required to do this 305 ! only the master is required to do this 306 307 ! 1D and slow_diagfi=.false. => open/close once 308 if ((klon_glo.eq.1).and.(.not.slow_diagfi)) then 309 ! if the very first time to write, open 310 if ((nom.eq.firstnom).and. 311 & (((zitau+1)/diagfi_output_rate).eq.1)) then 312 write(*,*) "Open NETCDF file for firstnom=", firstnom 313 write(*,*) "zitau=", zitau 314 ierr=NF_OPEN(fichnom,NF_WRITE,nid) ! open once in all simu 315 endif 316 else ! 3D or slow_diagfi=.true. => open/close at output frequency 317 ierr=NF_OPEN(fichnom,NF_WRITE,nid) 318 endif 319 291 320 if (nom.eq.firstnom) then 292 321 ! We have identified a "first call" (at given date) … … 625 654 endif ! of if (dim.eq.3) elseif(dim.eq.2)... 626 655 656 ! Only the master do it 657 if (is_master) then 658 ! 1D and slow_diagfi=.false. => open/close once 659 if ((klon_glo.eq.1).and.(.not.slow_diagfi)) then 660 ! if the very last time to write, close 661 if ((nom.eq.lastnom).and.(zitau.eq.lastzitau)) then 662 write(*,*) "Close NETCDF file for lastnom=",lastnom 663 write(*,*) "zitau=",zitau 664 ierr = NF_CLOSE(nid) ! close once in all simu 665 endif 666 else ! 3D or slow_diagfi=.true. => open/close at output frequency 667 ierr = NF_CLOSE(nid) 668 endif 669 endif 670 627 671 endif ! of if ( MOD(zitau+1,isample) .eq.0.) 628 672 629 if (is_master) then630 ierr= NF_CLOSE(nid)631 endif632 633 673 end -
trunk/LMDZ.PLUTO/libf/phypluto/writediagspecIR.F
r3749 r4027 180 180 call iniwrite_specIR(nid,day_ini,areafi_glo(1),1,1) 181 181 ENDIF 182 ! Close the NetCDF file 183 ierr= NF_CLOSE(nid) 182 184 endif ! of if (is_master) 183 185 184 186 zitau = -1 ! initialize zitau 185 else186 if (is_master) then187 ! Open the NetCDF file188 ierr = NF_OPEN(fichnom,NF_WRITE,nid)189 endif190 187 endif ! if (firstnom.eq.'1234567890') 191 188 … … 202 199 203 200 if ( MOD(zitau+1,isample) .eq.0.) then 201 202 if (is_master) then 203 ! Open the NetCDF file 204 ierr = NF_OPEN(fichnom,NF_WRITE,nid) 205 endif 204 206 205 207 ! Compute/write/extend 'Time' coordinate (date given in days) … … 334 336 endif ! of if (dimpx.eq.3) 335 337 338 ! Close the NetCDF file 339 if (is_master) then 340 ierr= NF_CLOSE(nid) 341 endif 342 336 343 endif ! of if ( MOD(zitau+1,isample) .eq.0.) 337 344 338 ! Close the NetCDF file339 if (is_master) then340 ierr= NF_CLOSE(nid)341 endif342 343 345 end -
trunk/LMDZ.PLUTO/libf/phypluto/writediagspecVI.F
r3749 r4027 179 179 call iniwrite_specVI(nid,day_ini,areafi_glo(1),1,1) 180 180 ENDIF 181 ! Close the NetCDF file 182 ierr= NF_CLOSE(nid) 181 183 endif ! of if (is_master) 182 184 183 185 zitau = -1 ! initialize zitau 184 else185 if (is_master) then186 ! Open the NetCDF file187 ierr = NF_OPEN(fichnom,NF_WRITE,nid)188 endif189 186 endif ! if (firstnom.eq.'1234567890') 190 187 … … 207 204 ! (like the 'histoire' outputs) 208 205 !-------------------------------------------------------- 206 207 if (is_master) then 208 ! Open the NetCDF file 209 ierr = NF_OPEN(fichnom,NF_WRITE,nid) 210 endif 209 211 210 212 if (nom.eq.firstnom) then … … 333 335 endif ! of if (dimpx.eq.3) 334 336 337 ! Close the NetCDF file 338 if (is_master) then 339 ierr= NF_CLOSE(nid) 340 endif 341 335 342 endif ! of if ( MOD(zitau+1,irythme) .eq.0.) 336 343 337 ! Close the NetCDF file338 if (is_master) then339 ierr= NF_CLOSE(nid)340 endif341 342 344 end
Note: See TracChangeset
for help on using the changeset viewer.
