Changeset 3500 for trunk


Ignore:
Timestamp:
Nov 8, 2024, 10:56:18 AM (13 days ago)
Author:
afalco
Message:

Pluto PCM: initialize soil layers when running without startphy_file.
AF

Location:
trunk/LMDZ.PLUTO/libf/phypluto
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.PLUTO/libf/phypluto/physiq_mod.F90

    r3483 r3500  
    527527      real :: annual_skin ! anuual skin depth (m)
    528528
     529      ! when no startfi file is asked for init
     530      real alpha,lay1 ! coefficients for building layers
     531      integer iloop
    529532
    530533      ! flags to trigger extra sanity checks
     
    599602#ifndef MESOSCALE
    600603         if (.not.startphy_file) then
     604           ! starting without startfi.nc and with callsoil
     605           ! is not yet possible as soildepth default is not defined
     606           if (callsoil) then
     607              ! default mlayer distribution, following a power law:
     608              !  mlayer(k)=lay1*alpha**(k-1/2)
     609              lay1=2.e-4
     610              alpha=2
     611              do iloop=0,nsoilmx-1
     612              mlayer(iloop)=lay1*(alpha**(iloop-0.5))
     613          enddo
     614              lay1=sqrt(mlayer(0)*mlayer(1))
     615              alpha=mlayer(1)/mlayer(0)
     616              do iloop=1,nsoilmx
     617                 layer(iloop)=lay1*(alpha**(iloop-1))
     618              enddo
     619           endif
    601620           ! additionnal "academic" initialization of physics
    602621           if (is_master) write(*,*) "Physiq: initializing tsurf(:) to pt(:,1) !!"
     
    10111030      ! enddo
    10121031
    1013       if (callsoil) then
     1032      if (firstcall.and.callsoil) then
    10141033         ! AF24 Originally in soil.F, but inertiedat is modified by surfprop
    10151034         ! Additional checks: is the vertical discretization sufficient
     
    10191038            inertia_min=minval(inertiedat(ig,:))
    10201039            inertia_max=maxval(inertiedat(ig,:))
     1040            print*, "inertia min max" , inertia_min, inertia_max
    10211041            ! diurnal and annual skin depth
    10221042            diurnal_skin=(inertia_min/volcapa)*sqrt(daysec/pi)
  • trunk/LMDZ.PLUTO/libf/phypluto/soil_settings.F

    r3184 r3500  
    3939!  ---------
    4040!  inputs:
    41       integer,intent(in) :: nid ! Input Netcdf file ID 
     41      integer,intent(in) :: nid ! Input Netcdf file ID
    4242      integer,intent(in) :: ngrid       ! # of horizontal grid points
    4343      integer,intent(in) :: nsoil       ! # of soil layers
     
    5555      integer ndims     ! # of dimensions of read <inertiedat> data
    5656      integer ig,iloop  ! loop counters
    57      
     57
    5858      integer edges(3),corner(3) ! to read a specific time
    5959
     
    8989        endif
    9090
    91         ! allocate oldmlayer 
     91        ! allocate oldmlayer
    9292        allocate(oldmlayer(dimlen),stat=ierr)
    9393        if (ierr.ne.0) then
     
    115115     &              'and thermal inertia will be required!'
    116116        endif
    117        
     117
    118118! 1.2 Find out the # of dimensions <inertiedat> was defined as using
    119119      ndims=inquire_field_ndims("inertiedat")
     
    135135          oldmlayer(iloop)=sqrt(887.75/3.14)*((2.**(iloop-0.5))-1.)
    136136        enddo
    137       else ! Look for depth 
     137      else ! Look for depth
    138138        ! read <depth> coordinate
    139139        if (interpol) then !put values in oldmlayer
     
    180180! 2. Volumetric heat capacity (note: it is declared in comsoil_h)
    181181! ---------------------------
    182 ! "volcapa" is (so far) 0D and written in "controle" table of startfi file 
     182! "volcapa" is (so far) 0D and written in "controle" table of startfi file
    183183! volcapa is read or set when "controle" is read (see tabfi.F)
    184184! Just in case, we check here that it is not zero. If it is, we
     
    210210         call abort
    211211       endif
    212        
     212
    213213       write(*,*)' => Building soil thermal inertia (using reference sur
    214214     &face thermal inertia)'
     
    242242       endif ! of if (interpol)
    243243      endif ! of if (ndims.eq.1)
    244      
     244
    245245! 4. Read soil temperatures
    246246! -------------------------
     
    275275           call abort
    276276         endif
    277        endif ! of if (interpol) 
     277       endif ! of if (interpol)
    278278      endif! of if (.not.ok)
    279279
     
    304304        deallocate(oldval)
    305305        deallocate(newval)
    306         interpol=.false. ! no need for interpolation any more     
     306        interpol=.false. ! no need for interpolation any more
    307307      endif !of if (olddepthdef)
    308308
     
    325325          inertiedat(ig,:)=newval(:)
    326326        enddo
    327        
     327
    328328      ! soil temperature
    329329        ! vertical coordinate
     
    339339          tsoil(ig,:)=newval(:)
    340340        enddo
    341        
     341
    342342        !cleanup
    343343        deallocate(oldgrid)
     
    347347        deallocate(oldtsoil)
    348348      endif ! of if (interpol)
    349      
     349
    350350! 6. Report min and max values of soil temperatures and thermal inertias
    351351! ----------------------------------------------------------------------
Note: See TracChangeset for help on using the changeset viewer.