Ignore:
Timestamp:
Dec 13, 2024, 5:17:13 PM (9 days 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/soil_settings.F

    r1538 r3552  
    8181! -------------------
    8282! 1.1 Start by reading how many layers of soil there are
    83         dimlen=inquire_dimension_length("subsurface_layers")
     83        dimlen=inquire_dimension_length(nid,"subsurface_layers")
    8484
    8585        if (dimlen.ne.nsoil) then
     
    9797
    9898        ! check if olmlayer distribution matches current one
    99         call get_var("soildepth",oldmlayer,found)
     99        call get_var(nid,"soildepth",oldmlayer,found)
    100100        if (found) then
    101101          malpha=oldmlayer(2)/oldmlayer(1)
     
    117117       
    118118! 1.2 Find out the # of dimensions <inertiedat> was defined as using
    119       ndims=inquire_field_ndims("inertiedat")
     119      ndims=inquire_field_ndims(nid,"inertiedat")
    120120! 1.3 Read depths values or set olddepthdef flag and values
    121121      if (ndims.eq.1) then ! we know that there is none
     
    138138        ! read <depth> coordinate
    139139        if (interpol) then !put values in oldmlayer
    140           call get_var("soildepth",oldmlayer,found)
     140          call get_var(nid,"soildepth",oldmlayer,found)
    141141          if (.not.found) then
    142142            write(*,*)'soil_settings: Problem while reading <soildepth>'
    143143          endif
    144144        else ! put values in mlayer
    145           call get_var("soildepth",mlayer,found)
     145          call get_var(nid,"soildepth",mlayer,found)
    146146          print*,"mlayer",mlayer
    147147          if (.not.found) then
     
    205205       ! Read Surface thermal inertia
    206206       allocate(surfinertia(ngrid))
    207        call get_field("inertiedat",surfinertia,found)
     207       call get_field(nid,"inertiedat",surfinertia,found)
    208208       if (.not.found) then
    209209         write(*,*) "soil_settings: Failed loading <inertiedat>"
     
    228228           endif
    229229         endif ! of if (.not.allocated(oldinertiedat))
    230         call get_field("inertiedat",oldinertiedat,found)
     230        call get_field(nid,"inertiedat",oldinertiedat,found)
    231231        if (.not.found) then
    232232          write(*,*) "soil_settings: Failed loading <inertiedat>"
     
    234234        endif
    235235       else ! put values in therm_i
    236          call get_field("inertiedat",inertiedat,found)
     236         call get_field(nid,"inertiedat",inertiedat,found)
    237237         if (.not.found) then
    238238           write(*,*) "soil_settings: Failed loading <inertiedat>"
     
    246246! -------------------------
    247247!      ierr=nf90_inq_varid(nid,"tsoil",nvarid)
    248       ok=inquire_field("tsoil")
     248      ok=inquire_field(nid,"tsoil")
    249249!      if (ierr.ne.nf90_noerr) then
    250250      if (.not.ok) then
     
    264264           endif
    265265         endif
    266          call get_field("tsoil",oldtsoil,found)
     266         call get_field(nid,"tsoil",oldtsoil,found)
    267267         if (.not.found) then
    268268           write(*,*) "soil_settings: Failed loading <tsoil>"
     
    270270         endif
    271271       else ! put values in tsoil
    272          call get_field("tsoil",tsoil,found,timeindex=indextime)
     272         call get_field(nid,"tsoil",tsoil,found,
     273     &                  timeindex=indextime)
    273274         if (.not.found) then
    274275           write(*,*) "soil_settings: Failed loading <tsoil>"
Note: See TracChangeset for help on using the changeset viewer.