Changeset 3908
- Timestamp:
- Sep 2, 2025, 4:07:53 PM (3 months ago)
- Location:
- trunk/LMDZ.GENERIC
- Files:
-
- 3 edited
-
changelog.txt (modified) (1 diff)
-
libf/dynphy_lonlat/phystd/newstart.F (modified) (22 diffs)
-
libf/phystd/tabfi_mod.F90 (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.GENERIC/changelog.txt
r3893 r3908 2098 2098 == 13/08/2025 == GM 2099 2099 Remove all "call abort" and "stop" statement in LMDZ.GENERIC and replacing them by call abort_physic(). 2100 2101 == 02/09/2025 == EM 2102 Fix some missing initializations in newstart and add 2103 option "Lmodif=2" when calling tabi from newstart to skip some checks 2104 which only make sense when called during a regular GCM run. -
trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/newstart.F
r3893 r3908 28 28 use datafile_mod, only: datadir, surfdir 29 29 use ioipsl_getin_p_mod, only: getin_p 30 use control_mod, only: day_step, iphysiq, anneeref, planet_type 30 use control_mod, only: day_step, iphysiq, anneeref, planet_type, 31 & timestart 31 32 use phyredem, only: physdem0, physdem1 32 33 use iostart, only: nid_start, open_startphy … … 42 43 USE ener_mod, ONLY: etot0,ptot0,ztot0,stot0,ang0 43 44 use tabfi_mod, only: tabfi 45 use time_phylmdz_mod, only: init_time 44 46 use dimphy, only: init_dimphy 45 47 use iniphysiq_mod, only: iniphysiq … … 149 151 ! REAL dteta(ip1jmp1,llm) 150 152 151 c Variable de l'ancienne grille152 c------------------------------153 153 real time 154 154 real tab_cntrl(100) 155 155 real tab_cntrl_bis(100) 156 156 157 c variables diverses157 c other variables 158 158 c------------------- 159 real choix_1,pp 159 integer :: infile_type 160 integer,parameter :: start_archive_file = 0 161 integer,parameter :: start_startfi_files = 1 162 real pp 160 163 character*80 fichnom 161 164 character*250 filestring … … 243 246 244 247 DO 245 read(*,*,iostat=ierr) choix_1 246 if ((choix_1 /= 0).OR.(choix_1 /=1)) EXIT 248 read(*,*,iostat=ierr) infile_type 249 if ((infile_type /= start_archive_file).OR. 250 & (infile_type /= start_startfi_files)) EXIT 247 251 ENDDO 248 252 249 253 c Open start_archive 250 254 c ~~~~~~~~~~~~~~~~~~~~~~~~~~ 251 if ( choix_1.eq.0) then255 if (infile_type.eq.start_archive_file) then 252 256 253 257 write(*,*) 'Creating start files from:' … … 296 300 297 301 c======================================================================= 298 c INITIALISATIONS DIVERSES302 c VARIOUS INITIALIZATIONS 299 303 c======================================================================= 300 304 … … 313 317 c Lecture du tableau des parametres du run (pour la dynamique) 314 318 c----------------------------------------------------------------------- 315 if ( choix_1.eq.0) then319 if (infile_type.eq.start_archive_file) then 316 320 317 321 write(*,*) 'reading tab_cntrl START_ARCHIVE' … … 324 328 #endif 325 329 c 326 else if ( choix_1.eq.1) then330 else if (infile_type.eq.start_startfi_files) then 327 331 328 332 write(*,*) 'reading tab_cntrl START' … … 354 358 write(*,*) 'Reading file START' 355 359 fichnom = 'start.nc' 360 ! initialization required for dynetat0: 361 timestart=-9999 ! default value; if <0, use last stored time 356 362 CALL dynetat0(fichnom,vcov,ucov,teta,q,masse, 357 363 . ps,phis,time) … … 430 436 read(*,*) pa 431 437 endif 432 c----------------------------------------------------------------------- 433 c Lecture du tab_cntrl et initialisation des constantes physiques 434 c - pour start: Lmodif = 0 => pas de modifications possibles 435 c (modif dans le tabfi de readfi + loin) 436 c - pour start_archive: Lmodif = 1 => modifications possibles 437 c----------------------------------------------------------------------- 438 if (choix_1.eq.0) then 438 !----------------------------------------------------------------------- 439 ! Load tab_cntrl array and initialize physics constants 440 ! - with Lmodif == 0 => values cannot be modified 441 ! - with Lmodif == 1 => values can be modified 442 ! - with Lmodif == 2 => values can be modified ; remove some extra 443 ! checks/tests done in tabfi not valid when 444 !----------------------------------------------------------------------- 445 if (infile_type.eq.start_archive_file) then 439 446 ! tabfi requires that input file be first opened by open_startphy(fichnom) 440 447 fichnom = 'start_archive.nc' 441 448 call open_startphy(fichnom,nid_start) 449 ! let tabfi know it is called from newstart 450 Lmodif=2 442 451 call tabfi (ngridmx,nid,Lmodif,tab0,day_ini,lllm,p_rad, 443 452 . p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time) 444 else if ( choix_1.eq.1) then453 else if (infile_type.eq.start_startfi_files) then 445 454 fichnom = 'startfi.nc' 446 455 call open_startphy(fichnom,nid_start) … … 482 491 483 492 ! Initialize the physics for start_archive only 484 IF ( choix_1.eq.0) THEN493 IF (infile_type.eq.start_archive_file) THEN 485 494 CALL iniphysiq(iim,jjm,llm, 486 495 & (jjm-1)*iim+2,comm_lmdz, … … 495 504 c======================================================================= 496 505 497 if ( choix_1.eq.0) then ! for start_archive files,506 if (infile_type.eq.start_archive_file) then ! for start_archive files, 498 507 ! where an external "surface.nc" file is needed 499 508 … … 565 574 CALL gr_dyn_fi(1,iip1,jjp1,ngridmx,ztheS,zthe) 566 575 567 endif ! of if ( choix_1.eq.0)576 endif ! of if (infile_type.eq.start_archive_file) 568 577 569 578 … … 572 581 c======================================================================= 573 582 574 if ( choix_1.eq.0) then583 if (infile_type.eq.start_archive_file) then 575 584 576 585 write(*,*) 'Reading file START_ARCHIVE' … … 587 596 ierr= NF_CLOSE(nid) 588 597 589 else if ( choix_1.eq.1) then598 else if (infile_type.eq.start_startfi_files) then 590 599 !do nothing, start and startfi have already been read 591 600 else … … 1584 1593 1585 1594 1586 if (( choix_1.eq.0).and.(.not.flagps0)) then1595 if ((infile_type.eq.start_archive_file).and.(.not.flagps0)) then 1587 1596 r = 1000.*8.31/mugaz 1588 1597 … … 1595 1604 end do 1596 1605 1597 c periodicite de ps en longitude1606 c ps periodicity in longitude 1598 1607 do j=1,jjp1 1599 1608 ps(1,j) = ps(iip1,j) … … 1606 1615 1607 1616 c======================================================================= 1608 c Initiali sation de la physique / ecriture de newstartfi:1617 c Initialize / write the new start files : 1609 1618 c======================================================================= 1610 1619 … … 1618 1627 1619 1628 CALL exner_hyb(ip1jmp1, ps, p3d, pks, pk, pkf) 1620 ! C alcul de la temperature potentielle teta1629 ! Compute potential temperature teta 1621 1630 1622 1631 if (flagtset) then … … 1629 1638 ENDDO 1630 1639 ENDDO 1631 else if ( choix_1.eq.0) then1640 else if (infile_type.eq.start_archive_file) then 1632 1641 DO l=1,llm 1633 1642 DO j=1,jjp1 … … 1642 1651 C Calcul intermediaire 1643 1652 c 1644 if ( choix_1.eq.0) then1653 if (infile_type.eq.start_archive_file) then 1645 1654 CALL massdair( p3d, masse ) 1646 1655 c … … 1663 1672 1664 1673 itau=0 1665 if ( choix_1.eq.0) then1674 if (infile_type.eq.start_archive_file) then 1666 1675 day_ini=int(date) 1667 1676 endif … … 1676 1685 CALL dynredem1("restart.nc",0.0,vcov,ucov,teta,q,masse,ps) 1677 1686 C 1678 C Ecriture etat initial physique1687 C Write physics initial state 1679 1688 C 1680 1689 -
trunk/LMDZ.GENERIC/libf/phystd/tabfi_mod.F90
r3893 r3908 76 76 ! Arguments 77 77 ! --------- 78 INTEGER,INTENT(IN) :: ngrid,nid,tab0 78 INTEGER,INTENT(IN) :: ngrid 79 INTEGER,INTENT(IN) :: nid ! 0: no file to read controle array from 80 ! /= 0 : read controle array from file 81 INTEGER,INTENT(IN) :: tab0 79 82 INTEGER*4,INTENT(OUT) :: day_ini 80 INTEGER,INTENT(IN) :: Lmodif 83 INTEGER,INTENT(IN) :: Lmodif ! 0: do not modifications 84 ! 1: enable modifications 85 ! 2: enable modifications but no sanity test 86 ! (needed when called from newstart) 81 87 INTEGER,INTENT(OUT) :: lmax 82 88 REAL,INTENT(OUT) :: p_rad,p_omeg,p_g,p_cpp,p_mugaz,p_daysec,time … … 208 214 volcapa = tab_cntrl(tab0+35) ! volumetric heat capacity 209 215 ! warn user if there has been a change in daysec or dtphys 210 if (daysec.ne.cntrl_daysec) then 216 if (Lmodif < 2) then 217 ! this is meaningful if called in PCM, but not when called from newstart 218 if (daysec.ne.cntrl_daysec) then 211 219 write(*,*) modname//" Warning: lenght of day daysec changed from ", & 212 220 cntrl_daysec," to ",daysec 213 endif214 if (dtphys.ne.cntrl_dtphys) then221 endif 222 if (dtphys.ne.cntrl_dtphys) then 215 223 write(*,*) modname//" Warning: time step dtphys changed from ", & 216 224 cntrl_dtphys," to ",dtphys 217 endif 225 endif 226 else 227 ! set dtphys and daysec to those from controle 228 daysec=cntrl_daysec 229 dtphys=cntrl_dtphys 230 endif ! of if (Lmodif < 2) 231 218 232 !----------------------------------------------------------------------- 219 233 ! Save some constants for later use (as routine arguments) … … 273 287 ! Modifications... 274 288 ! NB: Modifying controls should only be done by newstart, and in seq mode 275 if ((Lmodif .eq.1).and.is_parallel) then289 if ((Lmodif >= 1).and.is_parallel) then 276 290 write(*,*) "tabfi: Error modifying tab_control should", & 277 291 " only happen in serial mode (eg: by newstart)" … … 280 294 !----------------------------------------------------------------------- 281 295 282 IF(Lmodif .eq.1) then296 IF(Lmodif >= 1) then 283 297 284 298 write(*,*) … … 557 571 write(*,*) 558 572 559 ENDIF ! of if (Lmodif == 1)573 ENDIF ! of if (Lmodif >= 1) 560 574 561 575 !-----------------------------------------------------------------------
Note: See TracChangeset
for help on using the changeset viewer.
