Changeset 2959 for trunk/LMDZ.MARS/libf


Ignore:
Timestamp:
May 5, 2023, 3:15:04 PM (19 months ago)
Author:
romain.vande
Message:

Mars PCM :
Correct start2archive to write watercaptag correctly.
Watercaptag will be set to false and correctly handle by the PCM in the case where we change resolution.
+ Correct inertiesoil writting in start2archive
RV

Location:
trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars
Files:
4 edited

Legend:

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

    r2943 r2959  
    2626     &             subslope_dist,end_comslope_h,ini_comslope_h
    2727      use netcdf
     28      use surfdat_h, ONLY: watercaptag
    2829      implicit none
    2930
     
    139140      real totcloudfracS(iip1,jjp1)
    140141      real watercapS(iip1,jjp1,nslope)
     142      real watercaptagS(iip1,jjp1)
    141143      real albedoS(iip1,jjp1,nslope)
    142144
     
    177179      real, dimension(:,:,:), allocatable :: watercapold
    178180      real, dimension(:,:), allocatable :: watercapold_noslope
     181      real, dimension(:,:), allocatable :: watercaptagold
     182      real, dimension(:), allocatable :: watercaptag_tmp
    179183      real, dimension(:,:,:), allocatable :: albedoold
    180184      real, dimension(:,:), allocatable :: albedoold_noslope
     
    426430      allocate(totcloudfracold(imold+1,jmold+1))
    427431      allocate(watercapold(imold+1,jmold+1,nslope))
     432      allocate(watercaptagold(imold+1,jmold+1))
     433      allocate(watercaptag_tmp(ngrid))
    428434      allocate(albedoold(imold+1,jmold+1,nslope))
    429435     
     
    908914        IF (ierr .NE. NF_NOERR) THEN
    909915           PRINT*, "lect_start_archive: Failed loading <watercap>"
     916           PRINT*, NF_STRERROR(ierr)
     917           CALL abort
     918        ENDIF
     919      ENDIF
     920
     921c
     922      ierr = NF_INQ_VARID (nid, "watercaptag", nvarid)
     923      IF (ierr .NE. NF_NOERR) THEN
     924         PRINT*, "lect_start_archive: <watercaptag> not in file"
     925         PRINT*, "watercaptag set to false, will be adapted in
     926     &            surfini of PCM"
     927         watercaptagold(:,:) = 0
     928      ELSE
     929        ierr = nf90_get_var(nid, nvarid,watercaptagold)
     930        IF (ierr .NE. NF_NOERR) THEN
     931           PRINT*, "lect_start_archive: Failed loading <watercaptag>"
    910932           PRINT*, NF_STRERROR(ierr)
    911933           CALL abort
     
    12301252     &       watercap(:,1))
    12311253
     1254c Watercaptag
     1255      if(imold.eq.iim .and. jmold.eq.jjm) then
     1256      else
     1257       print *, "We are doing an horizontal interpolation,
     1258     &    watercaptag will be set to false and redefined proprely
     1259     &    in the PCM(surfini)"
     1260       watercaptagold(:,:)=0
     1261      endif
     1262        call interp_horiz (watercaptagold(:,:),watercaptags(:,:),
     1263     &       imold,jmold,iim,jjm,1,rlonuold,rlatvold,rlonu,rlatv)
     1264        call gr_dyn_fi (1,iim+1,jjm+1,ngrid,watercaptags(:,:),
     1265     &       watercaptag_tmp(:))
     1266
     1267        do i=1,ngrid
     1268          if(watercaptag_tmp(i).gt. 0.5) then
     1269            watercaptag(i)=.true.
     1270          else
     1271            watercaptag(i)=.false.
     1272          endif
     1273        enddo
     1274
     1275
    12321276c Surface albedo
    12331277      call interp_horiz (albedoold(:,:,1),albedoS(:,:,1),
     
    16051649      deallocate(totcloudfracold)
    16061650      deallocate(watercapold)
     1651      deallocate(watercaptagold)
    16071652      deallocate(albedoold)
    16081653      deallocate(var,varp1)
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive.F

    r2943 r2959  
    2020
    2121      use infotrac, only: infotrac_init, nqtot, tname
    22       use comsoil_h, only: nsoilmx, inertiedat
    23       use surfdat_h, only: ini_surfdat_h, qsurf
     22      use comsoil_h, only: nsoilmx, inertiedat, inertiesoil
     23      use surfdat_h, only: ini_surfdat_h, qsurf,watercaptag
    2424      use comsoil_h, only: ini_comsoil_h
    2525!      use comgeomphy, only: initcomgeomphy
     
    6666      REAL,ALLOCATABLE :: tsurf(:,:)        ! Surface temperature
    6767      REAL,ALLOCATABLE :: tsoil(:,:,:) ! Soil temperature
    68       REAL,ALLOCATABLE :: inertiesoil(:,:,:) ! Soil thermal inertia (!= inertiedat which is for present day climate)
    6968      REAL,ALLOCATABLE :: watercap(:,:)        ! h2o ice layer
    7069      REAL :: tauscaling(ngridmx) ! dust conversion factor
     
    8786      REAL ithS(ip1jmp1,nsoilmx) ! Soil Thermal Inertia for inertie dat (present day climate)
    8887      REAL,ALLOCATABLE :: watercapS(:,:)
     88      REAL,ALLOCATABLE :: watercaptag_tmp(:)
     89      REAL,ALLOCATABLE :: watercaptagS(:)
    8990      REAL :: tauscalingS(ip1jmp1)
    9091      REAL :: totcloudfracS(ip1jmp1)
     
    167168      allocate(tsurf(ngridmx,nslope))
    168169      allocate(tsoil(ngridmx,nsoilmx,nslope))
    169       allocate(inertiesoil(ngridmx,nsoilmx,nslope))
    170170      allocate(watercap(ngridmx,nslope))
    171171      allocate(emis(ngridmx,nslope))
     
    177177      allocate(inertiesoilS(ip1jmp1,nsoilmx,nslope))
    178178      allocate(watercapS(ip1jmp1,nslope))
     179      allocate(watercaptagS(ip1jmp1))
    179180      allocate(emisS(ip1jmp1,nslope))
    180181      allocate(albedoS(ip1jmp1,nslope))
     
    207208       ENDIF
    208209
     210         CALL surfini(ngridmx,qsurf)
     211
    209212      ierr = NF_CLOSE(nid1)
    210213
     
    287290     &    tsoilS(:,:,islope))
    288291      call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,inertiesoil(:,:,islope),
    289      &    inertiesoil(:,:,islope))
     292     &    inertiesoilS(:,:,islope))
    290293      ! Note: thermal inertia "inertiedat" is in comsoil.h
    291294      call gr_fi_dyn(1,ngridmx,iip1,jjp1,emis(:,islope),
     
    302305      call gr_fi_dyn(1,ngridmx,iip1,jjp1,tauscaling,tauscalingS)
    303306      call gr_fi_dyn(1,ngridmx,iip1,jjp1,totcloudfrac,totcloudfracS)
     307
     308      allocate(watercaptag_tmp(ngridmx))
     309      do ij=1,ngridmx
     310        if(watercaptag(ij)) then
     311        watercaptag_tmp(ij)=1
     312        else
     313        watercaptag_tmp(ij)=0
     314        endif
     315      enddo
     316
     317      call gr_fi_dyn(1,ngridmx,iip1,jjp1,watercaptag_tmp(:),
     318     &    watercaptagS(:))
    304319
    305320c=======================================================================
     
    402417      call write_archive(nid,ntime,'watercap','couche de glace h2o',
    403418     &  'kg/m2',2,watercapS)
     419      call write_archive(nid,ntime,'watercaptag','couche de glace h2o',
     420     &  'kg/m2',2,watercaptagS)
    404421      call write_archive(nid,ntime,'tauscaling',
    405422     &  'dust conversion factor',' ',2,tauscalingS)
     
    462479     &     'J.s-1/2.m-2.K-1',-3,inertiesoilS(:,:,:))
    463480! Write soil thermal inertia for current climate
    464       call write_archive(nid,ntime,'inertiedat - present day TI',
    465      &     'Soil thermal inertia',
     481      call write_archive(nid,ntime,'inertiedat',
     482     &     'Soil thermal inertia (present day TI)',
    466483     &     'J.s-1/2.m-2.K-1',-3,ithS)
    467484
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/start2archive_SSO.F

    r2943 r2959  
    2020
    2121      use infotrac, only: infotrac_init, nqtot, tname
    22       use comsoil_h, only: nsoilmx, inertiedat
     22      use comsoil_h, only: nsoilmx, inertiedat,inertiesoil
    2323      use surfdat_h, only: ini_surfdat_h, qsurf
    24       use comsoil_h, only: ini_comsoil_h
    2524!      use comgeomphy, only: initcomgeomphy
    2625      use filtreg_mod, only: inifilr
     
    6968      REAL,ALLOCATABLE :: tsurf(:,:)        ! Surface temperature
    7069      REAL,ALLOCATABLE :: tsoil(:,:,:) ! Soil temperature
    71       REAL,ALLOCATABLE :: inertiesoil(:,:,:) ! Soil thermal inertia (!= inertiedat which is for present day climate)
    7270      REAL,ALLOCATABLE :: watercap(:,:)        ! h2o ice layer
    7371      REAL tauscaling(ngridmx) ! dust conversion factor
     
    185183      allocate(tsurf(ngridmx,nslope))
    186184      allocate(tsoil(ngridmx,nsoilmx,nslope))
    187       allocate(inertiesoil(ngridmx,nsoilmx,nslope))
    188185      allocate(watercap(ngridmx,nslope))
    189186      allocate(emis(ngridmx,nslope))
     
    302299     &    tsoilS(:,:,islope))
    303300      call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,inertiesoil(:,:,islope),
    304      &    inertiesoil(:,:,islope))
     301     &    inertiesoilS(:,:,islope))
    305302      ! Note: thermal inertia "inertiedat" is in comsoil.h
    306303      call gr_fi_dyn(1,ngridmx,iip1,jjp1,emis(:,islope),
     
    313310     &    subslope_distS(:,islope))
    314311      enddo
     312
    315313      call gr_fi_dyn(nsoilmx,ngridmx,iip1,jjp1,inertiedat,ithS)
    316314      call gr_fi_dyn(llm+1,ngridmx,iip1,jjp1,q2,q2S)
     
    497495      call write_archive(nid,ntime,'tsoil','Soil temperature',
    498496     &     'K',-3,tsoilS(:,:,:))
     497
    499498! Write soil thermal inertia
    500499      call write_archive(nid,ntime,'inertiesoil','Soil TI',
  • trunk/LMDZ.MARS/libf/dynphy_lonlat/phymars/write_archive.F

    r2952 r2959  
    226226     &        nom.eq."ZGAM" .or. nom.eq."albedodat" .or.
    227227     &        nom.eq."z0" .or. nom.eq."summit" .or. nom.eq."hmons"
    228      &        .or. nom.eq."base") then
     228     &        .or. nom.eq."base".or. nom.eq."watercaptag") then
    229229
    230230           if (ierr /= NF_NOERR) then
Note: See TracChangeset for help on using the changeset viewer.