Ignore:
Timestamp:
Jul 15, 2011, 9:06:27 AM (13 years ago)
Author:
emillour
Message:

Mars GCM:

Implemented using 'z0' roughness length map (important: 'z0' reference

field is in datafile surface.nc, which has also been updated).

  • made z0 a z0(ngridmx) array and moved 'z0' from 'planete.h' to 'surfdat.h'; added a 'z0_default' (common in surfdat.h) corresponding to the 'control' array value (contole(19) in startfi.nc).
  • adapted 'tabfi.F' to use 'z0_default'.
  • adapted 'phyetat0.F' to look for a 'z0' field in startfi.nc. If 'z0' is not found in the startfi.nc file, then the uniform default value (z0_default) is used.
  • modified 'physdem1.F' to write 'z0' field to restart.nc
  • adapted use of z0() in 'physiq.F' (diagnostic computation of surface stress), 'vdifc.F' and 'vdif_cd.F'.
  • adapted 'dustdevil.F' to use 'z0_default'.
  • 'testphys1d.F' now uses 'z0_default', and the value to use can be set in run.def (with "z0=TheValueYouWant?").
  • modified 'datareadnc.F' to load reference map of 'z0' from surface.nc, and added a 'z0' option in 'newstart.F' to force a uniform value of z0. Note that the use of the z0 map is automatic when using newstart, but only when it loads a start_archive.nc file.
Location:
trunk/LMDZ.MARS/libf/phymars
Files:
11 edited

Legend:

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

    r164 r224  
    11c=======================================================================
    2       SUBROUTINE datareadnc(relief,phisinit,alb,ith,
    3      .                    zmea,zstd,zsig,zgam,zthe)
     2      SUBROUTINE datareadnc(relief,phisinit,alb,ith,z0,
     3     &                    zmea,zstd,zsig,zgam,zthe)
    44c=======================================================================
    55c
     
    6464      parameter    (iimp1=iim+1-1/iim)
    6565
    66       CHARACTER relief*3
    67 
     66! Arguments:
     67      CHARACTER(len=3),intent(inout) :: relief
     68      REAL,intent(out) :: phisinit(iimp1*jjp1)
     69      REAL,intent(out) :: alb(iimp1*jjp1)
     70      REAL,intent(out) :: ith(iimp1*jjp1)
     71      REAL,intent(out) :: z0(iimp1*jjp1)
     72      REAL,intent(out) :: zmea(imdp1*jmdp1)
     73      REAL,intent(out) :: zstd(imdp1*jmdp1)
     74      REAL,intent(out) :: zsig(imdp1*jmdp1)
     75      REAL,intent(out) :: zgam(imdp1*jmdp1)
     76      REAL,intent(out) :: zthe(imdp1*jmdp1)
     77
     78! Local variables:
    6879      REAL        zdata(imd*jmdp1)
    6980      REAL        zdataS(imdp1*jmdp1)
    7081      REAL        pfield(iimp1*jjp1)
    7182
    72       REAL        alb(iimp1*jjp1)
    73       REAL        ith(iimp1*jjp1)
    74       REAL        phisinit(iimp1*jjp1)
    75 
    76       REAL        zmea(imdp1*jmdp1)
    77       REAL        zstd(imdp1*jmdp1)
    78       REAL        zsig(imdp1*jmdp1)
    79       REAL        zgam(imdp1*jmdp1)
    80       REAL        zthe(imdp1*jmdp1)
    81 
    8283      INTEGER     ierr
    8384
     
    9596
    9697      CHARACTER*20 string
    97       DIMENSION string(4)
     98      DIMENSION string(0:4)
    9899
    99100
     
    123124        write(*,*)'1) You can set this path in the callphys.def file:'
    124125        write(*,*)'   datadir=/path/to/the/datafiles'
    125         write(*,*)'   OR specify the path to use in callphys.def, as:'
    126         write(*,*)'   datadir=/path/to/the/directory'
    127126        write(*,*)'2) If necessary, surface.nc (and other datafiles)'
    128127        write(*,*)'   can be obtained online on:'
     
    179178c=======================================================================
    180179
     180      string(0) = 'z0'
    181181      string(1) = 'albedo'
    182182      string(2) = 'thermal'
     
    192192 
    193193
    194       DO k=1,4
     194      DO k=0,4
    195195          write(*,*) 'string',k,string(k)
    196196         
     
    207207
    208208      ierr = NF_INQ_VARID (unit, string(k), nvarid)
     209      if (ierr.ne.nf_noerr) then
     210        write(*,*) 'datareadnc error, cannot find ',trim(string(k))
     211        write(*,*) ' in file ',trim(datafile),'/surface.nc'
     212        stop
     213      endif
    209214#ifdef NC_DOUBLE
    210215      ierr = NF_GET_VAR_DOUBLE(unit, nvarid, zdata)
     
    212217      ierr = NF_GET_VAR_REAL(unit, nvarid, zdata)
    213218#endif
     219      if (ierr.ne.nf_noerr) then
     220        write(*,*) 'datareadnc: error failed loading ',trim(string(k))
     221        stop
     222      endif
    214223
    215224c-----------------------------------------------------------------------
     
    261270c-----------------------------------------------------------------------
    262271
    263       if (k.eq.1) then                    ! albedo
     272      if (k.eq.0) then                    ! z0
     273         z0(1:iimp1*jjp1)=pfield(1:iimp1*jjp1)*.01
     274         ! multiplied by 0.01 to have z0 in m
     275         CALL dump2d(iimp1,jjp1,z0,'z0 in m')
     276      elseif (k.eq.1) then                    ! albedo
    264277         do i=1,iimp1*jjp1
    265278              alb(i) = pfield(i)
  • trunk/LMDZ.MARS/libf/phymars/dustdevil.F

    r38 r224  
    3030#include "comcstfi.h"     
    3131c#include "comconst.h"        ! TEMPORAIRE AVEC ANLDEVIL !!!!
    32 #include "planete.h"
     32#include "surfdat.h"
    3333#include "comgeomfi.h"
    3434#include "tracer.h"
     
    107107c
    108108         z1= -0.5*13.e3*log(pplev(1,2)/pplev(1,1))
    109          Cd = (0.4/log(z1/z0))**2
     109         Cd = (0.4/log(z1/z0_default))**2
    110110
    111111         firstcall=.false.
  • trunk/LMDZ.MARS/libf/phymars/phyetat0.F

    r38 r224  
    464464      xmax = MAXVAL(emis)
    465465      PRINT*,'Surface emissivity <emis>:', xmin, xmax
     466
     467!
     468! surface roughness length (NB: z0 is a common in surfdat.h)
     469!
     470      ierr=nf90_inq_varid(nid,"z0",nvarid)
     471      if (ierr.ne.nf90_noerr) then
     472        write(*,*) 'phyetat0: did not find z0 field!'
     473        write(*,*) 'will use constant value of z0_default instead'
     474        z0(:)=z0_default
     475      else
     476        ierr=nf90_get_var(nid,nvarid,z0)
     477        if (ierr.ne.nf90_noerr) then
     478          write(*,*) 'phyetat0: Failed loading <z0>'
     479          write(*,*)trim(nf90_strerror(ierr))
     480          call abort
     481        endif
     482        xmin=1.0E+20
     483        xmax=-1.0E+20
     484        xmin=minval(z0)
     485        xmax=maxval(z0)
     486        write(*,*)'Surface roughness <z0>:',xmin,xmax
     487      endif
     488
     489
    466490c
    467491c pbl wind variance
  • trunk/LMDZ.MARS/libf/phymars/physdem1.F

    r164 r224  
    6767      real pzsig(ngridmx),pzgam(ngridmx),pzthe(ngridmx)
    6868      integer ig
    69       INTEGER lnblnk
    70       EXTERNAL lnblnk
    7169
    7270! flag which identifies if we are using old tracer names (qsurf01,...)
     
    180178
    181179c Boundary layer and turbulence
    182       tab_cntrl(19) = z0        ! surface roughness (m) ~0.01
     180      tab_cntrl(19) = z0_default   ! default surface roughness (m) ~0.01
    183181      tab_cntrl(20) = lmixmin   ! mixing length ~100
    184182      tab_cntrl(21) = emin_turb ! minimal energy ~1.e-8
     
    518516      ierr = NF_PUT_VAR_REAL (nid,nvarid,emis)
    519517#endif
     518
     519! surface roughness length (z0 is a common in surfdat.h)
     520
     521      ierr = NF_REDEF (nid)
     522#ifdef NC_DOUBLE
     523      ierr = NF_DEF_VAR (nid, "z0", NF_DOUBLE, 1, idim2,nvarid)
     524#else
     525      ierr = NF_DEF_VAR (nid, "z0", NF_FLOAT, 1, idim2,nvarid)
     526#endif
     527      ierr = NF_PUT_ATT_TEXT (nid, nvarid, "title", 24,
     528     .                        "Surface roughness length")
     529      ierr = NF_ENDDEF(nid)
     530#ifdef NC_DOUBLE
     531      ierr = NF_PUT_VAR_DOUBLE (nid,nvarid,z0)
     532#else
     533      ierr = NF_PUT_VAR_REAL (nid,nvarid,z0)
     534#endif
     535
    520536
    521537c planetary boundary layer
  • trunk/LMDZ.MARS/libf/phymars/physiq.F

    r185 r224  
    10721072      ENDDO
    10731073
    1074 c    Compute surface stress : (NB: z0 is a common in planete.h)
     1074c    Compute surface stress : (NB: z0 is a common in surfdat.h)
    10751075c     DO ig=1,ngrid
    1076 c        cd = (0.4/log(zzlay(ig,1)/z0))**2
     1076c        cd = (0.4/log(zzlay(ig,1)/z0(ig)))**2
    10771077c        zstress(ig) = rho(ig,1)*cd*(zu(ig,1)**2 + zv(ig,1)**2)
    10781078c     ENDDO
  • trunk/LMDZ.MARS/libf/phymars/planete.h

    r38 r224  
    22c INCLUDE planet.h
    33
    4       COMMON/planet/aphelie,periheli,year_day,peri_day,
    5      $       obliquit,
    6      $       z0,lmixmin,emin_turb,coefvis,coefir,
    7      $       timeperi,e_elips,p_elips,unitastr
     4      COMMON/planet/aphelie,periheli,year_day,peri_day,                 &
     5     &       obliquit,                                                  &
     6     &       lmixmin,emin_turb,coefvis,coefir,                          &
     7     &       timeperi,e_elips,p_elips,unitastr
    88
    9       REAL aphelie,periheli,year_day,peri_day,
    10      $     obliquit,
    11      $     z0,lmixmin,emin_turb,coefvis,coefir,
    12      $       timeperi,e_elips,p_elips,unitastr
     9      REAL aphelie,periheli,year_day,peri_day,                          &
     10     &     obliquit,                                                    &
     11     &     lmixmin,emin_turb,coefvis,coefir,                            &
     12     &       timeperi,e_elips,p_elips,unitastr
    1313
    1414c-----------------------------------------------------------------------
  • trunk/LMDZ.MARS/libf/phymars/surfdat.h

    r38 r224  
    44     &   iceradius(2) , dtemisice(2),                                   &
    55     &   zmea(ngridmx),zstd(ngridmx),                                   &
    6      &   zsig(ngridmx),zgam(ngridmx),zthe(ngridmx)
     6     &   zsig(ngridmx),zgam(ngridmx),zthe(ngridmx),                     &
     7     &   z0(ngridmx),z0_default
    78
    89      COMMON/surfdatl/TESicealbedo
     
    1819      real iceradius , dtemisice
    1920      real zmea,zstd,zsig,zgam,zthe
     21      real z0 ! surface roughness lenght (m)
     22      real z0_default ! default (constant over planet) surface roughness (m)
  • trunk/LMDZ.MARS/libf/phymars/tabfi.F

    r38 r224  
    112112c Boundary layer and turbulence
    113113c----------------------------
    114       z0 =  1.e-2               ! surface roughness (m) ~0.01
     114      z0_default =  1.e-2       ! surface roughness (m) ~0.01
    115115      emin_turb = 1.e-6         ! minimal energy ~1.e-8
    116116      lmixmin = 30              ! mixing length ~100
     
    190190      obliquit = tab_cntrl(tab0+18)
    191191c boundary layer and turbeulence
    192       z0 = tab_cntrl(tab0+19)
     192      z0_default = tab_cntrl(tab0+19)
    193193      lmixmin = tab_cntrl(tab0+20)
    194194      emin_turb = tab_cntrl(tab0+21)
     
    244244      write(*,5) '(18)       obliquit',tab_cntrl(tab0+18),obliquit
    245245
    246       write(*,6) '(19)             z0',tab_cntrl(tab0+19),z0
     246      write(*,6) '(19)     z0_default',tab_cntrl(tab0+19),z0_default
    247247      write(*,6) '(21)      emin_turb',tab_cntrl(tab0+21),emin_turb
    248248      write(*,5) '(20)        lmixmin',tab_cntrl(tab0+20),lmixmin
     
    277277      write(*,*)
    278278      write(*,*) '(3)          day_ini : Initial day (=0 at Ls=0)'
    279       write(*,*) '(19)              z0 : surface roughness (m)'
     279      write(*,*) '(19)              z0 : default surface roughness (m)'
    280280      write(*,*) '(21)       emin_turb :  minimal energy (PBL)'
    281281      write(*,*) '(20)         lmixmin : mixing length (PBL)'
     
    317317
    318318        else if (modif(1:lnblnk(modif)) .eq. 'z0') then
    319           write(*,*) 'current value:',z0
    320           write(*,*) 'enter new value:'
    321  102      read(*,*,iostat=ierr) z0
     319          write(*,*) 'current value (m):',z0_default
     320          write(*,*) 'enter new value (m):'
     321 102      read(*,*,iostat=ierr) z0_default
    322322          if(ierr.ne.0) goto 102
    323323          write(*,*) ' '
    324           write(*,*) ' z0 (new value):',z0
     324          write(*,*) ' z0 (new value):',z0_default
    325325
    326326        else if (modif(1:lnblnk(modif)) .eq. 'emin_turb') then
     
    493493      write(*,5) '(18)       obliquit',tab_cntrl(tab0+18),obliquit
    494494 
    495       write(*,6) '(19)             z0',tab_cntrl(tab0+19),z0
     495      write(*,6) '(19)     z0_default',tab_cntrl(tab0+19),z0_default
    496496      write(*,6) '(21)      emin_turb',tab_cntrl(tab0+21),emin_turb
    497497      write(*,5) '(20)        lmixmin',tab_cntrl(tab0+20),lmixmin
  • trunk/LMDZ.MARS/libf/phymars/testphys1d.F

    r161 r224  
    122122c     Parametres Couche limite et Turbulence
    123123c     --------------------------------------
    124       z0 =  1.e-2                ! surface roughness (m) ~0.01
     124      z0_default =  1.e-2                ! surface roughness (m) ~0.01
    125125      emin_turb = 1.e-6          ! energie minimale ~1.e-8
    126126      lmixmin = 30               ! longueur de melange ~100
     
    399399      call getin("inertia",inertiedat(1,1))
    400400      write(*,*) " inertia = ",inertiedat(1,1)
     401
     402      z0(1)=z0_default ! default value for roughness
     403      write(*,*) 'Surface roughness length z0 (m)?'
     404      call getin("z0",z0(1))
     405      write(*,*) " z0 = ",z0(1)
    401406c
    402407c  pour le schema d'ondes de gravite
  • trunk/LMDZ.MARS/libf/phymars/vdif_cd.F

    r38 r224  
    3737
    3838      INTEGER ngrid,nlay
    39       REAL pz0
     39      REAL pz0(ngrid)
    4040      REAL pg,pz(ngrid,nlay)
    4141      REAL pu(ngrid,nlay),pv(ngrid,nlay)
     
    6262c     DO ig=1,ngrid
    6363c        zu2=pu(ig)*pu(ig)+pv(ig)*pv(ig)+umin2
    64 c        pcdv(ig)=pz0*(1.+sqrt(zu2))
     64c        pcdv(ig)=pz0(ig)*(1.+sqrt(zu2))
    6565c        pcdh(ig)=pcdv(ig)
    6666c     ENDDO
     
    8181c            zri=0.E+0
    8282c._.
    83 c         z1=1.+pz(ig)/pz0
     83c         z1=1.+pz(ig)/pz0(ig)
    8484c         zcd0=karman/log(z1)
    8585c._.         zcd0=zcd0*zcd0*sqrt(zu2)
     
    101101
    102102      DO ig=1,ngrid
    103          z1=1.E+0 + pz(ig,1)/pz0
     103         z1=1.E+0 + pz(ig,1)/pz0(ig)
    104104         zcd0=karman/log(z1)
    105105         zcd0=zcd0*zcd0
  • trunk/LMDZ.MARS/libf/phymars/vdifc.F

    r161 r224  
    5656      REAL co2ice (ngrid), ppopsk(ngrid,nlay)
    5757      logical lecrit
    58       REAL pz0
     58
     59      REAL pz0(ngridmx) ! surface roughness length (m)
    5960
    6061c    Traceurs :
Note: See TracChangeset for help on using the changeset viewer.