Changeset 2818 for trunk/LMDZ.MARS


Ignore:
Timestamp:
Nov 15, 2022, 11:25:41 AM (2 years ago)
Author:
llange
Message:

Log:
Mars GCM
Minor fix in soil_settings: oldmlayer was not allocated if dim(nlayer)
in the start != nsoil creating a seg.fault. The number of layers in the
soil can now be changed, as well as the power law.
LL

File:
1 edited

Legend:

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

    r2311 r2818  
    107107        ! soil temperatures and thermal inertia will be requiered
    108108          interpol=.true.
    109         endif
    110 
    111 ! 1.2 Find out the # of dimensions <inertiedat> was defined as using
    112 !     (in ye old days, thermal inertia was only given at the "surface")
    113       ! Look for thermal inertia data
    114 !      ierr=nf90_inq_varid(nid,"inertiedat",nvarid)
    115 !      if (ierr.NE.nf90_noerr) then
    116 !         write(*,*)'soil_settings: Field <inertiedat> not found!'
    117 !         write(*,*)trim(nf90_strerror(ierr))
    118 !         call abort
    119 !      endif
    120 !
    121 !      ! Read the # of dimensions <inertidat> was defined as using
    122 !      ierr=nf90_inquire_variable(nid,nvarid,ndims=ndims)
    123 !      ! if (ndims.eq.1) then we have the "old 2D-surface" format
    124       ndims=inquire_field_ndims("inertiedat")
    125 
    126 ! 1.3 Read depths values or set olddepthdef flag and values
    127       if (ndims.eq.1) then ! we know that there is none
    128         write(*,*)'soil_settings: no <soildepth> field expected'
    129         write(*,*)'building one mimicking old definitions'
    130         olddepthdef=.true.
    131         interpol=.true.
    132109        ! allocate oldmlayer
    133110        if (.not.allocated(oldmlayer)) then
     
    139116          endif
    140117        endif
     118        endif
     119
     120! 1.2 Find out the # of dimensions <inertiedat> was defined as using
     121!     (in ye old days, thermal inertia was only given at the "surface")
     122      ! Look for thermal inertia data
     123!      ierr=nf90_inq_varid(nid,"inertiedat",nvarid)
     124!      if (ierr.NE.nf90_noerr) then
     125!         write(*,*)'soil_settings: Field <inertiedat> not found!'
     126!         write(*,*)trim(nf90_strerror(ierr))
     127!         call abort
     128!      endif
     129!
     130!      ! Read the # of dimensions <inertidat> was defined as using
     131!      ierr=nf90_inquire_variable(nid,nvarid,ndims=ndims)
     132!      ! if (ndims.eq.1) then we have the "old 2D-surface" format
     133      ndims=inquire_field_ndims("inertiedat")
     134
     135! 1.3 Read depths values or set olddepthdef flag and values
     136      if (ndims.eq.1) then ! we know that there is none
     137        write(*,*)'soil_settings: no <soildepth> field expected'
     138        write(*,*)'building one mimicking old definitions'
     139        olddepthdef=.true.
     140        interpol=.true.
     141
    141142        do iloop=1,dimlen
    142143          oldmlayer(iloop)=sqrt(887.75/3.14)*((2.**(iloop-0.5))-1.)
Note: See TracChangeset for help on using the changeset viewer.