Ignore:
Timestamp:
Jun 5, 2018, 8:38:22 AM (6 years ago)
Author:
emillour
Message:

Mars GCM:
A first step towards 1+1=2 (for now only works without tracers):

  • store and load "albedo" (surface albedo) and wstar (thermals' max vertical velocity) in physics (re)start file.
  • turn phyetat0 into a module in the process.

EM

Location:
trunk/LMDZ.MARS/libf/phymars
Files:
5 edited
1 moved

Legend:

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

    r1920 r1944  
    2121     &                            ecritphy, iphysiq
    2222      use dimradmars_mod, only: tauscaling,tauvis,totcloudfrac
     23      use co2cloud_mod, only: mem_Mccn_co2, mem_Mh2o_co2,
     24     &                        mem_Nccn_co2
    2325      USE comvert_mod, ONLY: ap,bp,aps,bps,pa,preff,sig,
    2426     &                       presnivs,pseudoalt,scaleheight
     
    9294      REAL co2ice(1)        ! co2ice layer (kg.m-2)
    9395      REAL emis(1)          ! surface layer
     96      REAL albedo(1,1)      ! surface albedo
     97      REAL :: wstar(1)=0.    ! Thermals vertical velocity
    9498      REAL q2(nlayer+1)   ! Turbulent Kinetic Energy
    9599      REAL zlay(nlayer)   ! altitude estimee dans les couches (km)
     
    522526      call getin("albedo",albedodat(1))
    523527      write(*,*) " albedo = ",albedodat(1)
     528      albedo(1,1)=albedodat(1)
    524529
    525530      inertiedat(1,1)=400 ! default value for inertiedat
     
    593598      call getin("co2ice",co2ice)
    594599      write(*,*) " co2ice = ",co2ice
    595 
     600! Initialization for CO2 clouds (could be improved to read initial profiles)
     601      mem_Mccn_co2(:,:)=0
     602      mem_Mh2o_co2(:,:)=0
     603      mem_Nccn_co2(:,:)=0
    596604c
    597605c  emissivity
     
    710718     &              albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe)
    711719      call physdem1("startfi.nc",nsoilmx,ngrid,llm,nq,
    712      .              dtphys,time,
    713      .              tsurf,tsoil,co2ice,emis,q2,qsurf,tauscaling,
    714      .              totcloudfrac)
     720     &              dtphys,time,
     721     &              tsurf,tsoil,co2ice,albedo,emis,q2,qsurf,tauscaling,
     722     &              totcloudfrac,wstar,
     723     &              mem_Mccn_co2,mem_Nccn_co2,
     724     &              mem_Mh2o_co2)
    715725
    716726c=======================================================================
  • trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90

    r1940 r1944  
     1module phyetat0_mod
     2
     3implicit none
     4
     5contains
     6
    17subroutine phyetat0 (fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq, &
    2                      day_ini,time0,tsurf,tsoil,emis,q2,qsurf,co2ice, &
    3                      tauscaling,totcloudfrac,mem_Mccn_co2,mem_Nccn_co2,&
     8                     day_ini,time0,tsurf,tsoil,albedo,emis,q2,qsurf,co2ice, &
     9                     tauscaling,totcloudfrac,wstar,mem_Mccn_co2,mem_Nccn_co2,&
    410                     mem_Mh2o_co2)
    511
     
    4248  real,intent(out) :: tsurf(ngrid) ! surface temperature
    4349  real,intent(out) :: tsoil(ngrid,nsoil) ! soil temperature
     50  real,intent(out) :: albedo(ngrid,2) ! surface albedo
    4451  real,intent(out) :: emis(ngrid) ! surface emissivity
    4552  real,intent(out) :: q2(ngrid,nlay+1) !
     
    4855  real,intent(out) :: tauscaling(ngrid) ! dust conversion factor
    4956  real,intent(out) :: totcloudfrac(ngrid) ! total cloud fraction
     57  real,intent(out) :: wstar(ngrid) ! Max vertical velocity in thermals (m/s)
    5058  real,intent(out) :: mem_Mccn_co2(ngrid,nlay) ! Memory of CCN mass of H2O and dust used by CO2
    5159  real,intent(out) :: mem_Nccn_co2(ngrid,nlay) ! Memory of CCN number of H2O and dust used by CO2
     
    285293endif
    286294
     295! Max vertical velocity in thermals
     296call get_field("wstar",wstar,found,indextime)
     297if (.not.found) then
     298  write(*,*) "phyetat0: <totcloudfrac> not in file! Set to zero"
     299  wstar(:)=0
     300else
     301  write(*,*) "phyetat0: Max vertical velocity in thermals <wstar> range:", &
     302             minval(wstar),maxval(wstar)
     303endif
     304
    287305! Surface temperature :
    288306call get_field("tsurf",tsurf,found,indextime)
     
    294312             minval(tsurf), maxval(tsurf)
    295313endif
     314
     315! Surface albedo
     316call get_field("albedo",albedo(:,1),found,indextime)
     317if (.not.found) then
     318  write(*,*) "phyetat0: Failed loading <albedo>"
     319  albedo(:,1)=albedodat(:)
     320else
     321  write(*,*) "phyetat0: Surface albedo <albedo> range:", &
     322             minval(albedo(:,1)), maxval(albedo(:,1))
     323endif
     324albedo(:,2)=albedo(:,1)
    296325
    297326! Surface emissivity
     
    353382! Call to soil_settings, in order to read soil temperatures,
    354383! as well as thermal inertia and volumetric heat capacity
    355 
    356       call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime)
     384call soil_settings(nid_start,ngrid,nsoil,tsurf,tsoil,indextime)
    357385
    358386!
    359387! close file:
    360388!
    361       call close_startphy
    362 
    363       END
     389call close_startphy
     390
     391end subroutine phyetat0
     392
     393end module phyetat0_mod
  • trunk/LMDZ.MARS/libf/phymars/phyredem.F90

    r1922 r1944  
    144144
    145145subroutine physdem1(filename,nsoil,ngrid,nlay,nq, &
    146                     phystep,time,tsurf,tsoil,co2ice,emis,q2,qsurf,&
    147                     tauscaling,totcloudfrac,mem_Mccn_co2,mem_Nccn_co2,&
    148                     mem_Mh2o_co2)
     146                    phystep,time,tsurf,tsoil,co2ice,albedo,emis,q2,qsurf,&
     147                    tauscaling,totcloudfrac,wstar, &
     148                    mem_Mccn_co2,mem_Nccn_co2,mem_Mh2o_co2)
    149149  ! write time-dependent variable to restart file
    150150  use iostart, only : open_restartphy, close_restartphy, &
     
    166166  real,intent(in) :: tsoil(ngrid,nsoil)
    167167  real,intent(in) :: co2ice(ngrid)
     168  real,intent(in) :: albedo(ngrid,2)
    168169  real,intent(in) :: emis(ngrid)
    169170  real,intent(in) :: q2(ngrid,nlay+1)
     
    171172  real,intent(in) :: tauscaling(ngrid)
    172173  real,intent(in) :: totcloudfrac(ngrid)
     174  real,intent(in) :: wstar(ngrid)
    173175  real,intent(in) :: mem_Mccn_co2(ngrid,nlay) ! CCN mass of H2O and dust used by CO2
    174176  real,intent(in) :: mem_Nccn_co2(ngrid,nlay) ! CCN number of H2O and dust used by CO2
     
    197199  ! Soil temperature
    198200  call put_field("tsoil","Soil temperature",tsoil,time)
     201 
     202  ! Albedo of the surface
     203  call put_field("albedo","Surface albedo",albedo(:,1),time)
    199204 
    200205  ! Emissivity of the surface
     
    211216  ! Or by any user who wants to reconstruct dust, opacity from the start files.
    212217  call put_field("tauscaling","dust conversion factor",tauscaling,time)
     218
     219  if (calltherm) then
     220    call put_field("wstar","Max vertical velocity in thermals",wstar,time)
     221  endif
    213222
    214223  ! Tracers on the surface
  • trunk/LMDZ.MARS/libf/phymars/physiq_mod.F

    r1934 r1944  
    5959      use planetwide_mod
    6060      use phyredem, only: physdem0, physdem1
     61      use phyetat0_mod, only: phyetat0
    6162      use eofdump_mod, only: eofdump
    6263      USE vertical_layers_mod, ONLY: ap,bp,aps,bps
     
    435436     &         nsoilmx,ngrid,nlayer,nq,
    436437     &         day_ini,time_phys,
    437      &         tsurf,tsoil,emis,q2,qsurf,co2ice,tauscaling,
    438      &         totcloudfrac,mem_Mccn_co2,mem_Nccn_co2,
     438     &         tsurf,tsoil,albedo,emis,
     439     &         q2,qsurf,co2ice,tauscaling,totcloudfrac,wstar,
     440     &         mem_Mccn_co2,mem_Nccn_co2,
    439441     &         mem_Mh2o_co2)
    440442
     
    476478c        Initialize albedo and orbital calculation
    477479c        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    478          CALL surfini(ngrid,co2ice,qsurf,albedo)
     480         CALL surfini(ngrid,co2ice,qsurf)
    479481         CALL iniorbit(aphelie,periheli,year_day,peri_day,obliquit)
    480482
     
    18441846          call physdem1("restartfi.nc",nsoilmx,ngrid,nlayer,nq,
    18451847     .                ptimestep,ztime_fin,
    1846      .                tsurf,tsoil,co2ice,emis,q2,qsurf,tauscaling,
    1847      .                totcloudfrac,mem_Mccn_co2,mem_Nccn_co2,
    1848      .                mem_Mh2o_co2)
     1848     .                tsurf,tsoil,co2ice,albedo,emis,
     1849     .                q2,qsurf,tauscaling,totcloudfrac,wstar,
     1850     .                mem_Mccn_co2,mem_Nccn_co2,mem_Mh2o_co2)
    18491851         
    18501852         ENDIF
  • trunk/LMDZ.MARS/libf/phymars/surfini.F

    r1918 r1944  
    1       SUBROUTINE surfini(ngrid,piceco2,qsurf,psolaralb)
     1      SUBROUTINE surfini(ngrid,piceco2,qsurf)
    22
    33      USE ioipsl_getincom, only: getin
     
    1212      use mod_phys_lmdz_para, only : is_master, gather, scatter
    1313#endif
    14       USE comcstfi_h
     14      USE comcstfi_h, ONLY: pi
    1515      use mod_grid_phy_lmdz, only: nbp_lon, nbp_lat
    1616      use datafile_mod, only: datadir
     
    2929      real,intent(in) :: piceco2(ngrid) ! CO2 ice thickness
    3030      real,intent(inout) :: qsurf(ngrid,nqmx) ! tracer on surface (kg/m2)
    31       real,intent(out) :: psolaralb(ngrid,2) ! albedo
    3231
    3332      INTEGER ig,icap,iq,alternate
     
    458457       call scatter(watercaptag_glo,watercaptag)
    459458       
    460 ! end of #else of #ifdef MESOSCALE
    461        ENDIF ! (caps & water)
    462 #endif       
    463 
    464 c ===============================================================
    465 c      INITIAL ALBEDO
    466 c ===============================================================
    467 
    468          write(*,*)"surfini: water frost thickness",
    469      s     frost_albedo_threshold
    470          write(*,*)"surfini: water ice albedo:", albedo_h2o_ice
    471          write(*,*)"surfini: water ice TI:", inert_h2o_ice
    472 
    473 c        To start with : Initial albedo = observed dataset
    474 c        -------------------------------------------------
    475          DO ig=1,ngrid
    476               psolaralb(ig,1)=albedodat(ig)
    477               psolaralb(ig,2)=albedodat(ig)
    478          END DO
    479          PRINT*,'surfini: minimum albedo without water caps',
    480      &          minval(albedodat)
    481          PRINT*,'surfini: maximum albedo without water caps',
    482      &          maxval(albedodat)
    483 
    484 c        initial albedo if permanent H2O ice is present
    485 c        ------------------------------------------------
    486          IF ((water) .and. (caps)) THEN
    487            DO ig=1,ngrid
    488             IF (watercaptag(ig)) THEN
    489               psolaralb(ig,1) = albedo_h2o_ice
    490               psolaralb(ig,2) = albedo_h2o_ice
    491             ENDIF
    492            END DO
    493            PRINT*,'surfini: minimum albedo with water caps',
    494      &            minval(albedodat)
    495            PRINT*,'surfini: maximum albedo with water caps',
    496      &            maxval(albedodat)
    497 
    498          ENDIF
    499 
    500 c      changing initial albedo if CO2 ice is present
    501 c      -------------------------------------------
    502 
    503        DO ig=1,ngrid
    504          IF (piceco2(ig) .GT. 0.) THEN
    505              IF(latitude(ig).LT. 0.) THEN
    506                 icap=2 ! Southern hemisphere
    507              ELSE
    508                 icap=1 ! Northern hemisphere
    509              ENDIF
    510              psolaralb(ig,1) = albedice(icap)
    511              psolaralb(ig,2) = albedice(icap)   
    512          END IF
    513        END DO
    514 
    515 c      changing initial albedo if water ice frost is present
    516 c      -------------------------------------------
    517        IF (water) THEN
    518           do iq=1,nqmx
    519 c          if there is frost and surface albedo is set to albedo_h2o_ice
    520            if(noms(iq).eq."h2o_ice") then
    521              do ig=1,ngrid
    522              
    523               if ((watercaptag(ig).eqv..false.)
    524      &     .and. (qsurf(ig,iq).lt.-frost_albedo_threshold)) then
    525               print*, ''
    526               print*, '!!! PROBLEM in SURFINI !!!!'
    527               print*, 'FOUND NEGATIVE SURFACE ICE VALUE WHERE
    528      & WATERCAPTAG IS FALSE'
    529               print*, ''
    530               print*, 'ig,qsurf,threshold' ,
    531      &         ig, qsurf(ig,iq), -frost_albedo_threshold
    532               print*, ''
    533               print*, '1) Check h2o_ice in startfi and ice
    534      & distribution in surfini'
    535               print*, '2) Use ini_h2osurf option in newstart'
    536               print*, ''
    537 #ifndef MESOINI
    538               CALL ABORT
    539 #else
    540               qsurf(ig,iq) = 0.
    541 #endif
    542             endif
    543              
    544               if ((piceco2(ig) .eq. 0.).and.
    545      &          (qsurf(ig,iq).gt.frost_albedo_threshold)) then
    546                      psolaralb(ig,1) = albedo_h2o_ice
    547                      psolaralb(ig,2) = albedo_h2o_ice
    548 c                     PRINT*,'surfini.F frost',
    549 c     &                  latitude(ig)*180./pi, longitude(ig)*180./pi
    550                endif
    551               enddo
    552            endif
    553           end do
    554           PRINT*,'surfini: minimum albedo with frost and co2',
    555      &            minval(albedodat)
    556           PRINT*,'surfini: maximum albedo with frost and co2',
    557      &            maxval(albedodat)
    558459       ELSE
    559460         watercaptag(:) = .false.
    560        END IF ! OF IF(water)
    561          
    562       RETURN
     461       ENDIF ! (caps & water)
     462! end of #else of #ifndef MESOSCALE
     463#endif       
     464
    563465      END
  • trunk/LMDZ.MARS/libf/phymars/vdifc.F

    r1779 r1944  
    3636c   -------------
    3737
    38 #include "callkeys.h"
    39 #include "microphys.h"
     38      include "callkeys.h"
     39      include "microphys.h"
    4040
    4141c
     
    6666c    Argument added to account for subgrid gustiness :
    6767
    68       REAL wstar(ngrid), hfmax(ngrid)!, zi(ngrid)
     68      REAL,INTENT(IN) :: wstar(ngrid), hfmax(ngrid)!, zi(ngrid)
    6969
    7070c    Traceurs :
Note: See TracChangeset for help on using the changeset viewer.