Changeset 2832 for trunk/LMDZ.MARS/libf


Ignore:
Timestamp:
Nov 25, 2022, 4:05:58 PM (2 years ago)
Author:
emillour
Message:

Mars GCM:

  • follow-up to r2826-2829: adapt newstart and lect_start_archive to handle "old" start_archive files where surface co2 ice is stored as "co2ice".

EM

Location:
trunk/LMDZ.MARS/libf
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/lect_start_archive.F

    r2828 r2832  
    2525      implicit none
    2626
    27 #include "dimensions.h"
    28 #include "paramet.h"
    29 #include "comgeom2.h"
    30 #include "netcdf.inc"
     27      include "dimensions.h"
     28      include "paramet.h"
     29      include "comgeom2.h"
     30      include "netcdf.inc"
    3131c=======================================================================
    3232c   Declarations
     
    196196      real :: tmpval ! to store a temporary variable/value
    197197
     198      ! flag to check if CO2 surface ice is in "co2ice" (old start_archive)
     199      ! then it is set  to .true. or else it is in "co2_surf" (newer
     200      ! start_archive) and then .false.
     201      logical :: old_co2ice=.false.
    198202c=======================================================================
    199203
     
    702706      count=(/imold+1,jmold+1,1,0/)
    703707       
    704       ierr = NF_INQ_VARID (nid, "co2", nvarid)
    705       IF (ierr .NE. NF_NOERR) THEN
    706          PRINT*, "lect_start_archive: <co2> is missing"
    707          CALL abort
     708      ! look for CO2ice on the surface
     709      ! first try the "old" co2ice field for retro-compatibility:
     710      ierr = NF_INQ_VARID (nid, "co2ice", nvarid)
     711      IF (ierr .EQ. NF_NOERR) THEN
     712        WRITE(*,*)" Found co2ice => this is an 'old' start_archive"
     713        WRITE(*,*)" will read in 'co2ice' instead of 'co2_surf'"
     714        old_co2ice=.true.
     715      ELSE
     716        ! no 'co2ice', look for co2_surf instead
     717        ierr = NF_INQ_VARID (nid, "co2ice", nvarid)
     718        IF (ierr .NE. NF_NOERR) THEN
     719          PRINT*, "lect_start_archive: <co2_surf> is missing"
     720          PRINT*, NF_STRERROR(ierr)
     721          CALL abort
     722        ENDIF
    708723      ENDIF
    709724#ifdef NC_DOUBLE
     
    713728#endif
    714729      IF (ierr .NE. NF_NOERR) THEN
    715          PRINT*, "lect_start_archive: Failed loading <co2>"
    716          PRINT*, NF_STRERROR(ierr)
    717          CALL abort
     730        PRINT*, "lect_start_archive: Failed loading <co2ice>"
     731        PRINT*, NF_STRERROR(ierr)
     732        CALL abort
    718733      ENDIF
    719734c
     
    878893          if(txt.eq."co2_surf") then
    879894            igcm_co2=iq
     895            if (old_co2ice) then
     896              ! CO2 surface ice has already been loaded from "co2ice"
     897              cycle
     898            endif
    880899          endif
    881900        ENDIF ! of IF (oldtracernames)
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/newstart.F

    r2828 r2832  
    17861786     &              nsoilmx,ngridmx,llm,
    17871787     &              nqtot,dtphys,real(day_ini),0.0,cell_area,
    1788      &              albfi,ithfi,zmea,zstd,zsig,zgam,zthe,
    1789      &              hmons,summit,base)
     1788     &              albfi,ithfi)
    17901789      call physdem1("restartfi.nc",nsoilmx,ngridmx,llm,nqtot,
    17911790     &              dtphys,hour_ini,
  • trunk/LMDZ.MARS/libf/phymars/tracer_mod.F90

    r2826 r2832  
    180180      enddo
    181181
    182       if(co2_tracer_found .eq. .false.) then
     182      if(.not.co2_tracer_found) then
    183183         call abort_physic("ini_tracer_mod","co2 tracer is now mandatory",1)
    184184      endif
Note: See TracChangeset for help on using the changeset viewer.