Ignore:
Timestamp:
Dec 13, 2024, 5:17:13 PM (5 weeks ago)
Author:
emillour
Message:

Generic PCM

Modify iostart routines to take netcdf index as an argument in order to
be used to read/write in other files than startfi.nc (preparing 1D
restart)

MM

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/libf/phystd/phyetat0_mod.F90

    r3522 r3552  
    44
    55real, save :: tab_cntrl_mod(100)
     6
     7integer,save :: nid_start ! NetCDF file identifier for startfi.nc file
    68
    79!$OMP THREADPRIVATE(tab_cntrl_mod)
     
    109111if (startphy_file) then
    110112  ! open physics initial state file:
    111   call open_startphy(fichnom)
     113  call open_startphy(fichnom,nid_start)
    112114
    113115  ! possibility to modify tab_cntrl in tabfi
     
    124126if (startphy_file) then
    125127  ! Load surface geopotential:
    126   call get_field("phisfi",phisfi,found)
     128  call get_field(nid_start,"phisfi",phisfi,found)
    127129  if (.not.found) then
    128130    call abort_physic(modname,"Failed loading <phisfi>",1)
     
    136138if (startphy_file) then
    137139  ! Load bare ground albedo: (will be stored in surfdat_h)
    138   call get_field("albedodat",albedodat,found)
     140  call get_field(nid_start,"albedodat",albedodat,found)
    139141  if (.not.found) then
    140142    call abort_physic(modname,"Failed loading <albedodat>",1)
     
    152154if (startphy_file) then
    153155  ! Load surface albedo (for now assume it is spectrally homogeneous)
    154   call get_field("albedo",albedo(:,1),found)
     156  call get_field(nid_start,"albedo",albedo(:,1),found)
    155157  if (.not.found) then
    156158    write(*,*) modname//": Failed loading <albedo>"
     
    173175! ZMEA
    174176if (startphy_file) then
    175   call get_field("ZMEA",zmea,found)
     177  call get_field(nid_start,"ZMEA",zmea,found)
    176178  if (.not.found) then
    177179    call abort_physic(modname,"Failed loading <ZMEA>",1)
     
    185187! ZSTD
    186188if (startphy_file) then
    187   call get_field("ZSTD",zstd,found)
     189  call get_field(nid_start,"ZSTD",zstd,found)
    188190  if (.not.found) then
    189191    call abort_physic(modname,"Failed loading <ZSTD>",1)
     
    197199! ZSIG
    198200if (startphy_file) then
    199   call get_field("ZSIG",zsig,found)
     201  call get_field(nid_start,"ZSIG",zsig,found)
    200202  if (.not.found) then
    201203    call abort_physic(modname,"Failed loading <ZSIG>",1)
     
    209211! ZGAM
    210212if (startphy_file) then
    211   call get_field("ZGAM",zgam,found)
     213  call get_field(nid_start,"ZGAM",zgam,found)
    212214  if (.not.found) then
    213215    call abort_physic(modname,"Failed loading <ZGAM>",1)
     
    221223! ZTHE
    222224if (startphy_file) then
    223   call get_field("ZTHE",zthe,found)
     225  call get_field(nid_start,"ZTHE",zthe,found)
    224226  if (.not.found) then
    225227    call abort_physic(modname,"Failed loading <ZTHE>",1)
     
    233235! Surface temperature :
    234236if (startphy_file) then
    235   call get_field("tsurf",tsurf,found,indextime)
     237  call get_field(nid_start,"tsurf",tsurf,found,indextime)
    236238  if (.not.found) then
    237239    call abort_physic(modname,"Failed loading <tsurf>",1)
     
    245247! Surface emissivity
    246248if (startphy_file) then
    247   call get_field("emis",emis,found,indextime)
     249  call get_field(nid_start,"emis",emis,found,indextime)
    248250  if (.not.found) then
    249251    call abort_physic(modname,"Failed loading <emis>",1)
     
    262264if (CLFvarying) then
    263265  if (startphy_file) then
    264     call get_field("cloudfrac",cloudfrac,found,indextime)
     266    call get_field(nid_start,"cloudfrac",cloudfrac,found,indextime)
    265267    if (.not.found) then
    266268      call abort_physic(modname,"Failed loading <cloudfrac>",1)
     
    278280if (CLFvarying) then
    279281  if (startphy_file) then
    280     call get_field("totcloudfrac",totcloudfrac,found,indextime)
     282    call get_field(nid_start,"totcloudfrac",totcloudfrac,found,indextime)
    281283    if (.not.found) then
    282284      call abort_physic(modname,"Failed loading <totcloudfrac>",1)
     
    293295! Height of oceanic ice (added by BC 2010)
    294296if (startphy_file) then
    295   call get_field("hice",hice,found,indextime)
     297  call get_field(nid_start,"hice",hice,found,indextime)
    296298  if (.not.found) then
    297299    write(*,*) "phyetat0: Failed loading <hice>"
     
    308310if (startphy_file) then
    309311  ! nature of the surface
    310   call get_field("rnat",rnat,found,indextime)
     312  call get_field(nid_start,"rnat",rnat,found,indextime)
    311313  if (.not.found) then
    312314    write(*,*) "phyetat0: Failed loading <rnat>"
     
    329331if (startphy_file) then
    330332  ! Pourcentage of sea ice cover
    331   call get_field("pctsrf_sic",pctsrf_sic,found,indextime)
     333  call get_field(nid_start,"pctsrf_sic",pctsrf_sic,found,indextime)
    332334  if (.not.found) then
    333335    write(*,*) "phyetat0: Failed loading <pctsrf_sic>"
     
    342344if (startphy_file) then
    343345  ! Slab ocean temperature (2 layers)
    344   call get_field("tslab",tslab,found,indextime)
     346  call get_field(nid_start,"tslab",tslab,found,indextime)
    345347  if (.not.found) then
    346348    write(*,*) "phyetat0: Failed loading <tslab>"
     
    359361if (startphy_file) then
    360362  ! Oceanic ice temperature
    361   call get_field("tsea_ice",tsea_ice,found,indextime)
     363  call get_field(nid_start,"tsea_ice",tsea_ice,found,indextime)
    362364  if (.not.found) then
    363365    write(*,*) "phyetat0: Failed loading <tsea_ice>"
     
    372374if (startphy_file) then
    373375  ! Oceanic ice temperature
    374   call get_field("tice",tice,found,indextime)
     376  call get_field(nid_start,"tice",tice,found,indextime)
    375377  if (.not.found) then
    376378    write(*,*) "phyetat0: Failed loading <tice>"
     
    385387if (startphy_file) then
    386388  !  Oceanic ice quantity (kg/m^2)
    387   call get_field("sea_ice",sea_ice,found,indextime)
     389  call get_field(nid_start,"sea_ice",sea_ice,found,indextime)
    388390  if (.not.found) then
    389391    write(*,*) "phyetat0: Failed loading <sea_ice>"
     
    399401! pbl wind variance
    400402if (startphy_file) then
    401   call get_field("q2",q2,found,indextime)
     403  call get_field(nid_start,"q2",q2,found,indextime)
    402404  if (.not.found) then
    403405    call abort_physic(modname,"Failed loading <q2>",1)
     
    414416    txt=noms(iq)
    415417    if (startphy_file) then
    416       call get_field(txt,qsurf(:,iq),found,indextime)
     418      call get_field(nid_start,txt,qsurf(:,iq),found,indextime)
    417419      if (.not.found) then
    418420        write(*,*) "phyetat0: Failed loading <",trim(txt),">"
     
    440442! Non-orographic gravity waves
    441443if (startphy_file) then
    442    call get_field("du_nonoro_gwd",du_nonoro_gwd,found,indextime)
     444   call get_field(nid_start,"du_nonoro_gwd",du_nonoro_gwd,found,indextime)
    443445   if (.not.found) then
    444446      write(*,*) "phyetat0: <du_nonoro_gwd> not in file"
     
    451453endif ! of if (startphy_file)
    452454if (startphy_file) then
    453    call get_field("dv_nonoro_gwd",dv_nonoro_gwd,found,indextime)
     455   call get_field(nid_start,"dv_nonoro_gwd",dv_nonoro_gwd,found,indextime)
    454456   if (.not.found) then
    455457      write(*,*) "phyetat0: <dv_nonoro_gwd> not in file"
     
    462464endif ! of if (startphy_file)
    463465if (startphy_file) then
    464    call get_field("east_gwstress",east_gwstress,found,indextime)
     466   call get_field(nid_start,"east_gwstress",east_gwstress,found,indextime)
    465467   if (.not.found) then
    466468      write(*,*) "phyetat0: <east_gwstress> not in file"
     
    473475endif ! of if (startphy_file)
    474476if (startphy_file) then
    475    call get_field("west_gwstress",west_gwstress,found,indextime)
     477   call get_field(nid_start,"west_gwstress",west_gwstress,found,indextime)
    476478   if (.not.found) then
    477479      write(*,*) "phyetat0: <west_gwstress> not in file"
     
    486488! close file:
    487489!
    488 if (startphy_file) call close_startphy
     490if (startphy_file) call close_startphy(nid_start)
    489491
    490492end subroutine phyetat0
Note: See TracChangeset for help on using the changeset viewer.