Changeset 224 for trunk/LMDZ.MARS/libf/phymars
- Timestamp:
- Jul 15, 2011, 9:06:27 AM (13 years ago)
- Location:
- trunk/LMDZ.MARS/libf/phymars
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/datareadnc.F
r164 r224 1 1 c======================================================================= 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) 4 4 c======================================================================= 5 5 c … … 64 64 parameter (iimp1=iim+1-1/iim) 65 65 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: 68 79 REAL zdata(imd*jmdp1) 69 80 REAL zdataS(imdp1*jmdp1) 70 81 REAL pfield(iimp1*jjp1) 71 82 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 82 83 INTEGER ierr 83 84 … … 95 96 96 97 CHARACTER*20 string 97 DIMENSION string( 4)98 DIMENSION string(0:4) 98 99 99 100 … … 123 124 write(*,*)'1) You can set this path in the callphys.def file:' 124 125 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'127 126 write(*,*)'2) If necessary, surface.nc (and other datafiles)' 128 127 write(*,*)' can be obtained online on:' … … 179 178 c======================================================================= 180 179 180 string(0) = 'z0' 181 181 string(1) = 'albedo' 182 182 string(2) = 'thermal' … … 192 192 193 193 194 DO k= 1,4194 DO k=0,4 195 195 write(*,*) 'string',k,string(k) 196 196 … … 207 207 208 208 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 209 214 #ifdef NC_DOUBLE 210 215 ierr = NF_GET_VAR_DOUBLE(unit, nvarid, zdata) … … 212 217 ierr = NF_GET_VAR_REAL(unit, nvarid, zdata) 213 218 #endif 219 if (ierr.ne.nf_noerr) then 220 write(*,*) 'datareadnc: error failed loading ',trim(string(k)) 221 stop 222 endif 214 223 215 224 c----------------------------------------------------------------------- … … 261 270 c----------------------------------------------------------------------- 262 271 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 264 277 do i=1,iimp1*jjp1 265 278 alb(i) = pfield(i) -
trunk/LMDZ.MARS/libf/phymars/dustdevil.F
r38 r224 30 30 #include "comcstfi.h" 31 31 c#include "comconst.h" ! TEMPORAIRE AVEC ANLDEVIL !!!! 32 #include " planete.h"32 #include "surfdat.h" 33 33 #include "comgeomfi.h" 34 34 #include "tracer.h" … … 107 107 c 108 108 z1= -0.5*13.e3*log(pplev(1,2)/pplev(1,1)) 109 Cd = (0.4/log(z1/z0 ))**2109 Cd = (0.4/log(z1/z0_default))**2 110 110 111 111 firstcall=.false. -
trunk/LMDZ.MARS/libf/phymars/phyetat0.F
r38 r224 464 464 xmax = MAXVAL(emis) 465 465 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 466 490 c 467 491 c pbl wind variance -
trunk/LMDZ.MARS/libf/phymars/physdem1.F
r164 r224 67 67 real pzsig(ngridmx),pzgam(ngridmx),pzthe(ngridmx) 68 68 integer ig 69 INTEGER lnblnk70 EXTERNAL lnblnk71 69 72 70 ! flag which identifies if we are using old tracer names (qsurf01,...) … … 180 178 181 179 c Boundary layer and turbulence 182 tab_cntrl(19) = z0 !surface roughness (m) ~0.01180 tab_cntrl(19) = z0_default ! default surface roughness (m) ~0.01 183 181 tab_cntrl(20) = lmixmin ! mixing length ~100 184 182 tab_cntrl(21) = emin_turb ! minimal energy ~1.e-8 … … 518 516 ierr = NF_PUT_VAR_REAL (nid,nvarid,emis) 519 517 #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 520 536 521 537 c planetary boundary layer -
trunk/LMDZ.MARS/libf/phymars/physiq.F
r185 r224 1072 1072 ENDDO 1073 1073 1074 c Compute surface stress : (NB: z0 is a common in planete.h)1074 c Compute surface stress : (NB: z0 is a common in surfdat.h) 1075 1075 c DO ig=1,ngrid 1076 c cd = (0.4/log(zzlay(ig,1)/z0 ))**21076 c cd = (0.4/log(zzlay(ig,1)/z0(ig)))**2 1077 1077 c zstress(ig) = rho(ig,1)*cd*(zu(ig,1)**2 + zv(ig,1)**2) 1078 1078 c ENDDO -
trunk/LMDZ.MARS/libf/phymars/planete.h
r38 r224 2 2 c INCLUDE planet.h 3 3 4 COMMON/planet/aphelie,periheli,year_day,peri_day, 5 $ obliquit,6 $ z0,lmixmin,emin_turb,coefvis,coefir,7 $timeperi,e_elips,p_elips,unitastr4 COMMON/planet/aphelie,periheli,year_day,peri_day, & 5 & obliquit, & 6 & lmixmin,emin_turb,coefvis,coefir, & 7 & timeperi,e_elips,p_elips,unitastr 8 8 9 REAL aphelie,periheli,year_day,peri_day, 10 $ obliquit,11 $ z0,lmixmin,emin_turb,coefvis,coefir,12 $timeperi,e_elips,p_elips,unitastr9 REAL aphelie,periheli,year_day,peri_day, & 10 & obliquit, & 11 & lmixmin,emin_turb,coefvis,coefir, & 12 & timeperi,e_elips,p_elips,unitastr 13 13 14 14 c----------------------------------------------------------------------- -
trunk/LMDZ.MARS/libf/phymars/surfdat.h
r38 r224 4 4 & iceradius(2) , dtemisice(2), & 5 5 & zmea(ngridmx),zstd(ngridmx), & 6 & zsig(ngridmx),zgam(ngridmx),zthe(ngridmx) 6 & zsig(ngridmx),zgam(ngridmx),zthe(ngridmx), & 7 & z0(ngridmx),z0_default 7 8 8 9 COMMON/surfdatl/TESicealbedo … … 18 19 real iceradius , dtemisice 19 20 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 112 112 c Boundary layer and turbulence 113 113 c---------------------------- 114 z0 = 1.e-2! surface roughness (m) ~0.01114 z0_default = 1.e-2 ! surface roughness (m) ~0.01 115 115 emin_turb = 1.e-6 ! minimal energy ~1.e-8 116 116 lmixmin = 30 ! mixing length ~100 … … 190 190 obliquit = tab_cntrl(tab0+18) 191 191 c boundary layer and turbeulence 192 z0 = tab_cntrl(tab0+19)192 z0_default = tab_cntrl(tab0+19) 193 193 lmixmin = tab_cntrl(tab0+20) 194 194 emin_turb = tab_cntrl(tab0+21) … … 244 244 write(*,5) '(18) obliquit',tab_cntrl(tab0+18),obliquit 245 245 246 write(*,6) '(19) z0',tab_cntrl(tab0+19),z0246 write(*,6) '(19) z0_default',tab_cntrl(tab0+19),z0_default 247 247 write(*,6) '(21) emin_turb',tab_cntrl(tab0+21),emin_turb 248 248 write(*,5) '(20) lmixmin',tab_cntrl(tab0+20),lmixmin … … 277 277 write(*,*) 278 278 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)' 280 280 write(*,*) '(21) emin_turb : minimal energy (PBL)' 281 281 write(*,*) '(20) lmixmin : mixing length (PBL)' … … 317 317 318 318 else if (modif(1:lnblnk(modif)) .eq. 'z0') then 319 write(*,*) 'current value :',z0320 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 322 322 if(ierr.ne.0) goto 102 323 323 write(*,*) ' ' 324 write(*,*) ' z0 (new value):',z0 324 write(*,*) ' z0 (new value):',z0_default 325 325 326 326 else if (modif(1:lnblnk(modif)) .eq. 'emin_turb') then … … 493 493 write(*,5) '(18) obliquit',tab_cntrl(tab0+18),obliquit 494 494 495 write(*,6) '(19) z0',tab_cntrl(tab0+19),z0495 write(*,6) '(19) z0_default',tab_cntrl(tab0+19),z0_default 496 496 write(*,6) '(21) emin_turb',tab_cntrl(tab0+21),emin_turb 497 497 write(*,5) '(20) lmixmin',tab_cntrl(tab0+20),lmixmin -
trunk/LMDZ.MARS/libf/phymars/testphys1d.F
r161 r224 122 122 c Parametres Couche limite et Turbulence 123 123 c -------------------------------------- 124 z0 = 1.e-2 ! surface roughness (m) ~0.01124 z0_default = 1.e-2 ! surface roughness (m) ~0.01 125 125 emin_turb = 1.e-6 ! energie minimale ~1.e-8 126 126 lmixmin = 30 ! longueur de melange ~100 … … 399 399 call getin("inertia",inertiedat(1,1)) 400 400 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) 401 406 c 402 407 c pour le schema d'ondes de gravite -
trunk/LMDZ.MARS/libf/phymars/vdif_cd.F
r38 r224 37 37 38 38 INTEGER ngrid,nlay 39 REAL pz0 39 REAL pz0(ngrid) 40 40 REAL pg,pz(ngrid,nlay) 41 41 REAL pu(ngrid,nlay),pv(ngrid,nlay) … … 62 62 c DO ig=1,ngrid 63 63 c zu2=pu(ig)*pu(ig)+pv(ig)*pv(ig)+umin2 64 c pcdv(ig)=pz0 *(1.+sqrt(zu2))64 c pcdv(ig)=pz0(ig)*(1.+sqrt(zu2)) 65 65 c pcdh(ig)=pcdv(ig) 66 66 c ENDDO … … 81 81 c zri=0.E+0 82 82 c._. 83 c z1=1.+pz(ig)/pz0 83 c z1=1.+pz(ig)/pz0(ig) 84 84 c zcd0=karman/log(z1) 85 85 c._. zcd0=zcd0*zcd0*sqrt(zu2) … … 101 101 102 102 DO ig=1,ngrid 103 z1=1.E+0 + pz(ig,1)/pz0 103 z1=1.E+0 + pz(ig,1)/pz0(ig) 104 104 zcd0=karman/log(z1) 105 105 zcd0=zcd0*zcd0 -
trunk/LMDZ.MARS/libf/phymars/vdifc.F
r161 r224 56 56 REAL co2ice (ngrid), ppopsk(ngrid,nlay) 57 57 logical lecrit 58 REAL pz0 58 59 REAL pz0(ngridmx) ! surface roughness length (m) 59 60 60 61 c Traceurs :
Note: See TracChangeset
for help on using the changeset viewer.