Changeset 1047 for trunk/LMDZ.MARS/libf/phymars/phyetat0.F
- Timestamp:
- Sep 23, 2013, 9:56:47 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.MARS/libf/phymars/phyetat0.F
r1036 r1047 1 SUBROUTINE phyetat0 (fichnom,tab0,Lmodif,nsoil,n q,1 SUBROUTINE phyetat0 (fichnom,tab0,Lmodif,nsoil,ngrid,nlay,nq, 2 2 . day_ini,time0, 3 3 . tsurf,tsoil,emis,q2,qsurf,co2ice) … … 5 5 use netcdf 6 6 use infotrac, only: nqtot, tnom 7 use surfdat_h, only: phisfi, albedodat, z0, z0_default, 8 & zmea, zstd, zsig, zgam, zthe 7 9 8 10 implicit none … … 17 19 c====================================================================== 18 20 !#include "netcdf.inc" 19 #include "dimensions.h"20 #include "dimphys.h"21 !#include "dimensions.h" 22 !#include "dimphys.h" 21 23 !#include "comgeomfi.h" 22 #include "surfdat.h"24 !#include "surfdat.h" 23 25 #include "planete.h" 24 #include "dimradmars.h"25 #include "yomaer.h"26 !#include "dimradmars.h" 27 !#include "yomaer.h" 26 28 #include "comcstfi.h" 27 29 !#include "tracer.h" … … 35 37 ! --------- 36 38 ! inputs: 37 character*(*) fichnom ! "startfi.nc" file 38 integer tab0 39 integer Lmodif 40 integer nsoil ! # of soil layers 41 integer nq 42 integer day_ini 43 real time0 39 character*(*),intent(in) :: fichnom ! "startfi.nc" file 40 integer,intent(in) :: tab0 41 integer,intent(in) :: Lmodif 42 integer,intent(in) :: nsoil ! # of soil layers 43 integer,intent(in) :: ngrid ! # of atmospheric columns 44 integer,intent(in) :: nlay ! # of atmospheric layers 45 integer,intent(in) :: nq 46 integer :: day_ini 47 real :: time0 44 48 45 49 ! outputs: 46 real tsurf(ngridmx) ! surface temperature47 real tsoil(ngridmx,nsoil) ! soil temperature48 real emis(ngridmx) ! surface emissivity49 real q2(ngridmx, llm+1) !50 real qsurf(ngridmx,nq) ! tracers on surface51 real co2ice(ngridmx) ! co2 ice cover50 real,intent(out) :: tsurf(ngrid) ! surface temperature 51 real,intent(out) :: tsoil(ngrid,nsoil) ! soil temperature 52 real,intent(out) :: emis(ngrid) ! surface emissivity 53 real,intent(out) :: q2(ngrid,nlay+1) ! 54 real,intent(out) :: qsurf(ngrid,nq) ! tracers on surface 55 real,intent(out) :: co2ice(ngrid) ! co2 ice cover 52 56 53 57 !====================================================================== 54 58 ! Local variables: 55 59 56 real surffield(ngrid mx) ! to temporarily store a surface field60 real surffield(ngrid) ! to temporarily store a surface field 57 61 real xmin,xmax ! to display min and max of a field 58 62 c … … 248 252 CALL abort 249 253 ENDIF 250 xmin = 1.0E+20 251 xmax = -1.0E+20 252 DO i = 1, ngridmx 253 xmin = MIN(zmea(i),xmin) 254 xmax = MAX(zmea(i),xmax) 255 ENDDO 254 xmin = MINVAL(zmea) 255 xmax = MAXVAL(zmea) 256 256 PRINT*,'<zmea>:', xmin, xmax 257 257 c … … 270 270 CALL abort 271 271 ENDIF 272 xmin = 1.0E+20 273 xmax = -1.0E+20 274 DO i = 1, ngridmx 275 xmin = MIN(zstd(i),xmin) 276 xmax = MAX(zstd(i),xmax) 277 ENDDO 272 xmin = MINVAL(zstd) 273 xmax = MAXVAL(zstd) 278 274 PRINT*,'<zstd>:', xmin, xmax 279 275 c … … 292 288 CALL abort 293 289 ENDIF 294 xmin = 1.0E+20 295 xmax = -1.0E+20 296 DO i = 1, ngridmx 297 xmin = MIN(zsig(i),xmin) 298 xmax = MAX(zsig(i),xmax) 299 ENDDO 290 xmin = MINVAL(zsig) 291 xmax = MAXVAL(zsig) 300 292 PRINT*,'<zsig>:', xmin, xmax 301 293 c … … 314 306 CALL abort 315 307 ENDIF 316 xmin = 1.0E+20 317 xmax = -1.0E+20 318 DO i = 1, ngridmx 319 xmin = MIN(zgam(i),xmin) 320 xmax = MAX(zgam(i),xmax) 321 ENDDO 308 xmin = MINVAL(zgam) 309 xmax = MAXVAL(zgam) 322 310 PRINT*,'<zgam>:', xmin, xmax 323 311 c … … 336 324 CALL abort 337 325 ENDIF 338 xmin = 1.0E+20 339 xmax = -1.0E+20 340 DO i = 1, ngridmx 341 xmin = MIN(zthe(i),xmin) 342 xmax = MAX(zthe(i),xmax) 343 ENDDO 326 xmin = MINVAL(zthe) 327 xmax = MAXVAL(zthe) 344 328 PRINT*,'<zthe>:', xmin, xmax 345 329 … … 417 401 corner(1)=1 418 402 corner(2)=indextime 419 edges(1)=ngrid mx403 edges(1)=ngrid 420 404 edges(2)=1 421 405 ierr=nf90_inq_varid(nid,"co2ice",nvarid) … … 486 470 ! IF (nbsrf >= 2) THEN 487 471 ! DO nsrf = 2, nbsrf 488 ! DO i = 1, ngrid mx472 ! DO i = 1, ngrid 489 473 ! tsurf(i,nsrf) = tsurf(i,1) 490 474 ! ENDDO … … 506 490 ! PRINT*, "phyetat0: Le champ <tsoil> est absent" 507 491 ! PRINT*, " Il prend donc la valeur de surface" 508 ! DO i=1, ngrid mx492 ! DO i=1, ngrid 509 493 ! tsoil(i,isoil,nsrf)=tsurf(i,nsrf) 510 494 ! ENDDO … … 549 533 550 534 ! 551 ! surface roughness length (NB: z0 is a common in surfdat .h)535 ! surface roughness length (NB: z0 is a common in surfdat_h) 552 536 ! 553 537 ierr=nf90_inq_varid(nid,"z0",nvarid) … … 577 561 corner(2)=1 578 562 corner(3)=indextime 579 edges(1)=ngrid mx580 edges(2)= llm+1563 edges(1)=ngrid 564 edges(2)=nlay+1 581 565 edges(3)=1 582 566 ierr=nf90_inq_varid(nid,"q2",nvarid) … … 602 586 corner(1)=1 603 587 corner(2)=indextime 604 edges(1)=ngrid mx588 edges(1)=ngrid 605 589 edges(2)=1 606 590 IF(nq.GE.1) THEN … … 628 612 & ' not found in file' 629 613 write(*,*) trim(txt), ' set to 0' 630 do ig=1,ngrid mx614 do ig=1,ngrid 631 615 qsurf(ig,iq)=0. 632 616 end do … … 635 619 !ierr=nf90_get_var(nid,nvarid,qsurf(1,iq)) 636 620 ierr=nf90_get_var(nid,nvarid,surffield,corner,edges) 637 qsurf(1:ngrid mx,iq)=surffield(1:ngridmx)621 qsurf(1:ngrid,iq)=surffield(1:ngrid) 638 622 IF (ierr.NE.nf90_noerr) THEN 639 623 PRINT*, 'phyetat0: Lecture echouee pour <',trim(txt),'>' … … 644 628 xmin = 1.0E+20 645 629 xmax = -1.0E+20 646 xmin = MINVAL(qsurf(1:ngrid mx,iq))647 xmax = MAXVAL(qsurf(1:ngrid mx,iq))630 xmin = MINVAL(qsurf(1:ngrid,iq)) 631 xmax = MAXVAL(qsurf(1:ngrid,iq)) 648 632 PRINT*,'tracer on surface <',trim(txt),'>:',xmin,xmax 649 633 ENDDO … … 660 644 ! if (yes.eq.'y') then 661 645 ! write(*,*) 'OK, let s reindex qsurf' 662 ! do ig=1,ngrid mx646 ! do ig=1,ngrid 663 647 ! do iq=nqtot,nqtot-nqold+1,-1 664 648 ! qsurf(ig,iq)=qsurf(ig,iq-nqtot+nqold) … … 675 659 ! as well as thermal inertia and volumetric heat capacity 676 660 677 call soil_settings(nid,ngrid mx,nsoil,tsurf,tsoil,indextime)661 call soil_settings(nid,ngrid,nsoil,tsurf,tsoil,indextime) 678 662 c 679 663 c Fermer le fichier:
Note: See TracChangeset
for help on using the changeset viewer.