Changeset 3908 for trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/newstart.F
- Timestamp:
- Sep 2, 2025, 4:07:53 PM (3 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.
