Changeset 1542 for trunk


Ignore:
Timestamp:
Apr 18, 2016, 8:45:35 AM (9 years ago)
Author:
emillour
Message:

Generic GCM:

  • fix for 1D in writediagfi to enable writing at "ecritphy" rate.
  • move iniprint.h to "misc"
  • Some code cleanup in anticipation of future updates:
    • changed variable names in comgeomphy.F90: give them more explicit names: rlond => longitude , rlatd => latitude, airephy => cell_area, cuphy => dx , cvphy => dy
    • removed long(), lati() and area() from comgeomfi_h.F90, use longitude(), latitude() and cell_are() from comgeomphy.F90 instead

EM

Location:
trunk/LMDZ.GENERIC
Files:
1 deleted
22 edited
1 moved

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.GENERIC/README

    r1540 r1542  
    11901190- "iniprint.h" moved from "dyn3d" to "misc".
    11911191
    1192 
     1192== 18/04/2016 == EM
     1193- fix for 1D in writediagfi to enable writing at
     1194  "ecritphy" rate.
     1195- move iniprint.h to "misc"
     1196- Some code cleanup in anticipation of future updates:
     1197 - changed variable names in comgeomphy.F90: give them more
     1198   explicit names: rlond => longitude ,
     1199   rlatd => latitude, airephy => cell_area,
     1200   cuphy => dx , cvphy => dy
     1201 - removed long(), lati() and area() from comgeomfi_h.F90,
     1202   use longitude(), latitude() and cell_are() from
     1203   comgeomphy.F90 instead
     1204
     1205
  • trunk/LMDZ.GENERIC/libf/dynphy_lonlat/phystd/iniphysiq_mod.F90

    r1529 r1542  
    1616use control_mod, only: nday
    1717use comgeomphy, only : initcomgeomphy, &
    18                        airephy, & ! physics grid area (m2)
    19                        cuphy, & ! cu coeff. (u_covariant = cu * u)
    20                        cvphy, & ! cv coeff. (v_covariant = cv * v)
    21                        rlond, & ! longitudes
    22                        rlatd ! latitudes
     18                       cell_area, & ! physics grid area (m2)
     19                       dx, & ! cu coeff. (u_covariant = cu * u)
     20                       dy, & ! cv coeff. (v_covariant = cv * v)
     21                       longitude, & ! longitudes (rad)
     22                       latitude ! latitudes (rad)
    2323use surf_heat_transp_mod, only: ini_surf_heat_transp
    2424use infotrac, only : nqtot ! number of advected tracers
     
    170170
    171171offset=klon_mpi_begin-1
    172 airephy(1:klon_omp)=airefi(offset+klon_omp_begin:offset+klon_omp_end)
    173 cuphy(1:klon_omp)=cufi(offset+klon_omp_begin:offset+klon_omp_end)
    174 cvphy(1:klon_omp)=cvfi(offset+klon_omp_begin:offset+klon_omp_end)
    175 rlond(1:klon_omp)=lonfi(offset+klon_omp_begin:offset+klon_omp_end)
    176 rlatd(1:klon_omp)=latfi(offset+klon_omp_begin:offset+klon_omp_end)
     172cell_area(1:klon_omp)=airefi(offset+klon_omp_begin:offset+klon_omp_end)
     173dx(1:klon_omp)=cufi(offset+klon_omp_begin:offset+klon_omp_end)
     174dy(1:klon_omp)=cvfi(offset+klon_omp_begin:offset+klon_omp_end)
     175longitude(1:klon_omp)=lonfi(offset+klon_omp_begin:offset+klon_omp_end)
     176latitude(1:klon_omp)=latfi(offset+klon_omp_begin:offset+klon_omp_end)
    177177
    178178! copy over preff , ap() and bp()
     
    191191! and do some initializations
    192192call inifis(klon_omp,nlayer,nqtot,pdayref,punjours,nday,ptimestep, &
    193             rlatd,rlond,airephy,prad,pg,pr,pcpp)
     193            latitude,longitude,cell_area,prad,pg,pr,pcpp)
    194194
    195195!$OMP END PARALLEL
  • trunk/LMDZ.GENERIC/libf/phystd/aeropacity.F90

    r1397 r1542  
    44       use radinc_h, only : L_TAUMAX,naerkind
    55       use aerosol_mod
    6        USE comgeomfi_h
    76       USE tracer_h, only: noms,rho_co2,rho_ice
    87       use comcstfi_mod, only: g
  • trunk/LMDZ.GENERIC/libf/phystd/comgeomfi_h.F90

    r1520 r1542  
    44       implicit none
    55
    6        REAL,ALLOCATABLE,DIMENSION(:),SAVE :: long,lati,area
    7        REAL,SAVE :: totarea, totarea_planet
    8 !$OMP THREADPRIVATE(long,lati,area,totarea,totarea_planet)
     6       REAL,SAVE :: totarea ! total surface (m2) for this local (MPI/OpenMP) domain
     7       REAL,SAVE :: totarea_planet ! total planetary surface (m2)
     8!$OMP THREADPRIVATE(totarea,totarea_planet)
    99
    1010       end module comgeomfi_h
  • trunk/LMDZ.GENERIC/libf/phystd/comgeomphy.F90

    r1216 r1542  
    11module comgeomphy
    2    real,save,allocatable :: airephy(:)
    3    real,save,allocatable :: cuphy(:)
    4    real,save,allocatable :: cvphy(:)
    5    real,save,allocatable :: rlatd(:)
    6    real,save,allocatable :: rlond(:)
    7 !$OMP THREADPRIVATE(airephy,cuphy,cvphy,rlatd,rlond)
     2   real,save,allocatable :: cell_area(:) ! mesh area (m2)
     3   real,save,allocatable :: dx(:) ! mesh width along longitude (m)
     4   real,save,allocatable :: dy(:) ! mesh width along latitude (m)
     5   real,save,allocatable :: latitude(:) ! in radians
     6   real,save,allocatable :: longitude(:) ! in radians
     7!$OMP THREADPRIVATE(cell_area,dx,dy,latitude,longitude)
    88contains
    99 
     
    1313   
    1414 
    15     allocate(airephy(klon_omp))
    16     allocate(cuphy(klon_omp))
    17     allocate(cvphy(klon_omp))
    18     allocate(rlatd(klon_omp))
    19     allocate(rlond(klon_omp))
     15    allocate(cell_area(klon_omp))
     16    allocate(dx(klon_omp))
     17    allocate(dy(klon_omp))
     18    allocate(latitude(klon_omp))
     19    allocate(longitude(klon_omp))
    2020
    2121  end subroutine initcomgeomphy
  • trunk/LMDZ.GENERIC/libf/phystd/condense_co2.F90

    r1526 r1542  
    1111      use aerosol_mod, only : iaero_co2
    1212      USE surfdat_h, only: emisice, emissiv
    13       USE comgeomfi_h, only: lati
     13      USE comgeomphy, only: latitude ! in radians
    1414      USE tracer_h, only: noms, rho_co2
    1515      use comcstfi_mod, only: g, r, cpp
     
    430430      DO ig=1,ngrid
    431431     
    432          IF(lati(ig).LT.0.) THEN
     432         IF(latitude(ig).LT.0.) THEN
    433433            icap=2 ! Southern Hemisphere
    434434         ELSE
  • trunk/LMDZ.GENERIC/libf/phystd/dyn1d/rcm1d.F

    r1539 r1542  
    1111!      use comsaison_h
    1212      use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat, volcapa
    13       USE comgeomfi_h, only: lati, long, area
    1413      use phyredem, only: physdem0,physdem1
    15       use comgeomphy, only: initcomgeomphy, airephy
     14      use comgeomphy, only: initcomgeomphy, cell_area
    1615      use slab_ice_h, only: noceanmx
    1716      use planete_mod, only: apoastr,periastr,year_day,peri_day,
     
    159158      IF (.not.ALLOCATED(sinlon)) ALLOCATE(sinlon(1))
    160159      IF (.not.ALLOCATED(coslon)) ALLOCATE(coslon(1))
    161       !! those are defined in comgeomfi_h
    162       IF (.not. ALLOCATED(lati)) ALLOCATE(lati(1))
    163       IF (.not. ALLOCATED(long)) ALLOCATE(long(1))
    164       IF (.not. ALLOCATED(area)) ALLOCATE(area(1))
    165 
    166160
    167161      saveprofile=.false.
     
    326320!!! GEOGRAPHICAL INITIALIZATIONS
    327321     !!! AREA. useless in 1D
    328       area(1)=1.E+0
    329       airephy(1)=area(1) !JL+EM to have access to the area in the diagfi.nc files. area in comgeomfi.h and aire in comgeom.h
     322      cell_area(1)=1.E+0 !JL+EM to have access to the area in the diagfi.nc files.
    330323     !!! GEOPOTENTIAL. useless in 1D because control by surface pressure
    331324      phisfi(1)=0.E+0
     
    511504      cpp=1.d-7 !JL because we divide by cpp in inifis, there may be a more elegant solution
    512505      CALL inifis(1,llm,nq,day0,daysec,nday,dtphys,
    513      .            latitude,longitude,area,rad,g,r,cpp)
     506     .            latitude,longitude,cell_area,rad,g,r,cpp)
    514507
    515508      nsoil=nsoilmx
     
    673666         IF (qsurf(i_co2_ice).ge.1.E+0) THEN
    674667            ! if we have some CO2 ice on the surface, change emissivity
    675             if (lati(1).ge.0) then ! northern hemisphere
     668            if (latitude(1).ge.0) then ! northern hemisphere
    676669              emis(1)=emisice(1)
    677670            else ! southern hemisphere
     
    834827c  It is needed to transfert physics variables to "physiq"...
    835828
    836       call physdem0("startfi.nc",long,lati,nsoilmx,1,llm,nq,
    837      &              dtphys,real(day0),time,area,
     829      call physdem0("startfi.nc",longitude,latitude,nsoilmx,1,llm,nq,
     830     &              dtphys,real(day0),time,cell_area,
    838831     &              albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe)
    839832      call physdem1("startfi.nc",nsoilmx,1,llm,nq,
     
    843836     &                rnat,pctsrf_sic,tslab,tsea_ice,sea_ice)
    844837
    845 !      call physdem1(1,"startfi.nc",long,lati,nsoilmx,nq,
    846 !     &              dtphys,float(day0),
    847 !     &              time,tsurf,tsoil,emis,q2,qsurf,
    848 !     &              area,albedodat,inertiedat,zmea,zstd,zsig,zgam,zthe,
    849 !     &              cloudfrac,totcloudfrac,hice,nametrac)
    850 
    851838c=======================================================================
    852839c  BOUCLE TEMPORELLE DU MODELE 1D
     
    861848         call stellarlong(day*1.0,zls)
    862849!         write(103,*) 'Ls=',zls*180./pi
    863 !         write(103,*) 'Lat=', lati(1)*180./pi
     850!         write(103,*) 'Lat=', latitude(1)*180./pi
    864851!         write(103,*) 'RunEnd - Atmos. Temp. File'
    865852!         write(103,*) 'RunEnd - Atmos. Temp. File'
    866853!         write(104,*) 'Ls=',zls*180./pi
    867 !         write(104,*) 'Lat=', lati(1)
     854!         write(104,*) 'Lat=', latitude(1)
    868855!         write(104,*) 'RunEnd - Atmos. Temp. File'
    869856        ENDIF
     
    923910
    924911c       Pour certain test : pas de coriolis a l'equateur
    925 c       if(lati(1).eq.0.) then
     912c       if(latitude(1).eq.0.) then
    926913          DO ilayer=1,nlayer
    927914             du(ilayer)=du(ilayer)+ (gru-u(ilayer))/1.e4
  • trunk/LMDZ.GENERIC/libf/phystd/hydrol.F90

    r1537 r1542  
    1010  USE surfdat_h
    1111  use comdiurn_h
    12   USE comgeomfi_h
     12  USE comgeomphy, only: cell_area
    1313  USE tracer_h
    1414  use slab_ice_h
     
    141141         do ig=1,ngrid
    142142            if(nint(rnat(ig)).eq.0)then
    143                oceanarea=oceanarea+area(ig)
     143               oceanarea=oceanarea+cell_area(ig)
    144144            endif
    145145         enddo
     
    338338         DO ig=1,ngrid
    339339            if((nint(rnat(ig)).eq.0).and.(hice(ig).eq.0.))then
    340                oceanarea2=oceanarea2+area(ig)*pcapcal(ig)
     340               oceanarea2=oceanarea2+cell_area(ig)*pcapcal(ig)
    341341            end if
    342342         END DO
     
    345345         DO ig=1,ngrid
    346346            if((nint(rnat(ig)).eq.0).and.(hice(ig).eq.0.))then       
    347                tsea=tsea+ztsurf(ig)*area(ig)*pcapcal(ig)/oceanarea2
     347               tsea=tsea+ztsurf(ig)*cell_area(ig)*pcapcal(ig)/oceanarea2
    348348            end if
    349349         END DO
     
    366366         do ig=1,ngrid
    367367            if (nint(rnat(ig)).eq.1) then
    368                totalrunoff = totalrunoff + area(ig)*runoff(ig)
     368               totalrunoff = totalrunoff + cell_area(ig)*runoff(ig)
    369369            endif
    370370         enddo
  • trunk/LMDZ.GENERIC/libf/phystd/inifis_mod.F90

    r1538 r1542  
    1313  use datafile_mod, only: datadir
    1414  use comdiurn_h, only: sinlat, coslat, sinlon, coslon
    15   use comgeomfi_h, only: long, lati, area, totarea, totarea_planet
     15  use comgeomfi_h, only: totarea, totarea_planet
    1616  use comsoil_h, only: ini_comsoil_h, nsoilmx, lay1_soil, alpha_soil
    1717  use time_phylmdz_mod, only: ecritphy,day_step,iphysiq, &
     
    710710!     ------------------------
    711711
    712   ! ALLOCATE ARRAYS IN comgeomfi_h
    713   IF (.not. ALLOCATED(lati)) ALLOCATE(lati(ngrid))
    714   IF (.not. ALLOCATED(long)) ALLOCATE(long(ngrid))
    715   IF (.not. ALLOCATED(area)) ALLOCATE(area(ngrid))
    716 
    717   CALL SCOPY(ngrid,plon,1,long,1)
    718   CALL SCOPY(ngrid,plat,1,lati,1)
    719   CALL SCOPY(ngrid,parea,1,area,1)
    720   totarea=SSUM(ngrid,area,1)
    721   call planetwide_sumval(area,totarea_planet)
     712  ! Initializations for comgeomfi_h
     713  totarea=SSUM(ngrid,parea,1)
     714  call planetwide_sumval(parea,totarea_planet)
    722715
    723716  !! those are defined in comdiurn_h.F90
  • trunk/LMDZ.GENERIC/libf/phystd/initracer.F

    r1529 r1542  
    22
    33      use surfdat_h
    4       USE comgeomfi_h
    54      USE tracer_h
    65      USE callkeys_mod, only: water
  • trunk/LMDZ.GENERIC/libf/phystd/mass_redistribution.F90

    r1529 r1542  
    77       use surfdat_h
    88       use radcommon_h, only: glat
    9        USE comgeomfi_h
    109       USE tracer_h
    1110       USE planete_mod, only: bp
  • trunk/LMDZ.GENERIC/libf/phystd/phyredem.F90

    r1524 r1542  
    1010! create physics restart file and write time-independent variables
    1111  use comsoil_h, only: volcapa, mlayer
    12   use comgeomfi_h, only: area
     12  use comgeomphy, only: cell_area
    1313  use surfdat_h, only: zmea, zstd, zsig, zgam, zthe, &
    1414                       emisice, emissiv,             &
     
    111111 
    112112  ! Write mesh areas
    113   call put_field("area","Mesh area",area)
     113  call put_field("area","Mesh area",cell_area)
    114114 
    115115  ! Write surface geopotential
  • trunk/LMDZ.GENERIC/libf/phystd/physiq.F90

    r1529 r1542  
    1919      use comsaison_h, only: mu0, fract, dist_star, declin, right_ascen
    2020      use comsoil_h, only: nsoilmx, layer, mlayer, inertiedat
    21       USE comgeomfi_h, only: long, lati, area, totarea, totarea_planet
     21      use comgeomphy, only: latitude, longitude, cell_area
     22      USE comgeomfi_h, only: totarea, totarea_planet
    2223      USE tracer_h, only: noms, mmol, radius, rho_q, qext, &
    2324                          alpha_lift, alpha_devil, qextrhor, &
     
    697698
    698699         if (ngrid.ne.1) then ! Note : no need to create a restart file in 1d.
    699             call physdem0("restartfi.nc",long,lati,nsoilmx,ngrid,nlayer,nq, &
    700                           ptimestep,pday+nday,time_phys,area,               &
     700            call physdem0("restartfi.nc",longitude,latitude,nsoilmx,ngrid,nlayer,nq, &
     701                          ptimestep,pday+nday,time_phys,cell_area,          &
    701702                          albedo_bareground,inertiedat,zmea,zstd,zsig,zgam,zthe)
    702703         endif
     
    757758         gmplanet = MassPlanet*grav*1e24
    758759         do ig=1,ngrid
    759             glat(ig)= gmplanet/(Rmean**2) * (1.D0 + 0.75 *J2 - 2.0*flatten/3. + (2.*flatten - 15./4.* J2) * cos(2. * (pi/2. - lati(ig))))
     760            glat(ig)= gmplanet/(Rmean**2) * (1.D0 + 0.75 *J2 - 2.0*flatten/3. + (2.*flatten - 15./4.* J2) * cos(2. * (pi/2. - latitude(ig))))
    760761         end do
    761762      endif
     
    787788            zh(ig,l)=pt(ig,l)/zpopsk(ig,l)
    788789            mass(ig,l)  = (pplev(ig,l) - pplev(ig,l+1))/glat(ig)
    789             massarea(ig,l)=mass(ig,l)*area(ig)
     790            massarea(ig,l)=mass(ig,l)*cell_area(ig)
    790791         enddo
    791792      enddo
     
    800801      do l=1,nlayer
    801802         pw(1:ngrid,l)=(pw(1:ngrid,l)*r*pt(1:ngrid,l)) /  &
    802                        (pplay(1:ngrid,l)*area(1:ngrid))
     803                       (pplay(1:ngrid,l)*cell_area(1:ngrid))
    803804      enddo
    804805
     
    830831            else if(diurnal .eqv. .false.) then
    831832
    832                call mucorr(ngrid,declin,lati,mu0,fract,10000.,rad,flatten)
     833               call mucorr(ngrid,declin,latitude,mu0,fract,10000.,rad,flatten)
    833834               ! WARNING: this function appears not to work in 1D
    834835
     
    925926
    926927                            !if(noradsurf)then ! no lower surface; SW flux just disappears
    927                             !   GSR = SUM(fluxsurf_sw(1:ngrid)*area(1:ngrid))/totarea
     928                            !   GSR = SUM(fluxsurf_sw(1:ngrid)*cell_area(1:ngrid))/totarea
    928929                            !   fluxrad_sky(1:ngrid)=emis(1:ngrid)*fluxsurf_lw(1:ngrid)
    929930                            !   print*,'SW lost in deep atmosphere = ',GSR,' W m^-2'
     
    985986            call planetwide_sumval(cpp*massarea(:,:)*zdtsw(:,:)/totarea_planet,dEtotSW)
    986987            call planetwide_sumval(cpp*massarea(:,:)*zdtlw(:,:)/totarea_planet,dEtotLW)
    987             !call planetwide_sumval(fluxsurf_sw(:)*(1.-albedo_equivalent(:))*area(:)/totarea_planet,dEtotsSW) !JL13 carefull, albedo can have changed since the last time we called corrk
    988             call planetwide_sumval(fluxsurfabs_sw(:)*area(:)/totarea_planet,dEtotsSW) !JL13 carefull, albedo can have changed since the last time we called corrk
    989             call planetwide_sumval((fluxsurf_lw(:)*emis(:)-zplanck(:))*area(:)/totarea_planet,dEtotsLW)
     988            !call planetwide_sumval(fluxsurf_sw(:)*(1.-albedo_equivalent(:))*cell_area(:)/totarea_planet,dEtotsSW) !JL13 carefull, albedo can have changed since the last time we called corrk
     989            call planetwide_sumval(fluxsurfabs_sw(:)*cell_area(:)/totarea_planet,dEtotsSW) !JL13 carefull, albedo can have changed since the last time we called corrk
     990            call planetwide_sumval((fluxsurf_lw(:)*emis(:)-zplanck(:))*cell_area(:)/totarea_planet,dEtotsLW)
    990991            dEzRadsw(:,:)=cpp*mass(:,:)*zdtsw(:,:)
    991992            dEzRadlw(:,:)=cpp*mass(:,:)*zdtlw(:,:)
     
    10711072            enddo
    10721073           
    1073             call planetwide_sumval(dEdiff(:)*area(:)/totarea_planet,dEtot)
     1074            call planetwide_sumval(dEdiff(:)*cell_area(:)/totarea_planet,dEtot)
    10741075            dEdiffs(:)=capcal(:)*zdtsdif(:)-zflubid(:)-sensibFlux(:)
    1075             call planetwide_sumval(dEdiffs(:)*area(:)/totarea_planet,dEtots)
    1076             call planetwide_sumval(sensibFlux(:)*area(:)/totarea_planet,AtmToSurf_TurbFlux)
     1076            call planetwide_sumval(dEdiffs(:)*cell_area(:)/totarea_planet,dEtots)
     1077            call planetwide_sumval(sensibFlux(:)*cell_area(:)/totarea_planet,AtmToSurf_TurbFlux)
    10771078           
    10781079            if (is_master) then
     
    10971098         
    10981099            call planetwide_sumval(massarea(:,:)*zdqdif(:,:,igcm_h2o_vap)*ptimestep/totarea_planet,dWtot_tmp)
    1099             call planetwide_sumval(zdqsdif(:,igcm_h2o_vap)*area(:)*ptimestep/totarea_planet,dWtots_tmp)
     1100            call planetwide_sumval(zdqsdif(:,igcm_h2o_vap)*cell_area(:)*ptimestep/totarea_planet,dWtots_tmp)
    11001101            do ig = 1, ngrid
    11011102               vdifcncons(ig)=SUM(mass(ig,:)*zdqdif(ig,:,igcm_h2o_vap))
    11021103            enddo
    11031104            call planetwide_sumval(massarea(:,:)*zdqdif(:,:,igcm_h2o_ice)*ptimestep/totarea_planet,dWtot)
    1104             call planetwide_sumval(zdqsdif(:,igcm_h2o_ice)*area(:)*ptimestep/totarea_planet,dWtots)
     1105            call planetwide_sumval(zdqsdif(:,igcm_h2o_ice)*cell_area(:)*ptimestep/totarea_planet,dWtots)
    11051106            dWtot = dWtot + dWtot_tmp
    11061107            dWtots = dWtots + dWtots_tmp
     
    12141215         if(enertest)then
    12151216            call planetwide_sumval(cpp*massarea(:,:)*zdtc(:,:)/totarea_planet,dEtot)
    1216             call planetwide_sumval(capcal(:)*zdtsurfc(:)*area(:)/totarea_planet,dEtots)
     1217            call planetwide_sumval(capcal(:)*zdtsurfc(:)*cell_area(:)/totarea_planet,dEtots)
    12171218            if (is_master) then
    12181219               print*,'In co2cloud atmospheric energy change   =',dEtot,' W m-2'
     
    13351336                  if (is_master) print*,'In rain atmospheric T energy change       =',dEtot,' W m-2'
    13361337                  call planetwide_sumval(massarea(:,:)*zdqrain(:,:,igcm_h2o_ice)/totarea_planet*RLVTT/cpp,dItot_tmp)
    1337                   call planetwide_sumval(area(:)*zdqssnow(:)/totarea_planet*RLVTT/cpp,dItot)
     1338                  call planetwide_sumval(cell_area(:)*zdqssnow(:)/totarea_planet*RLVTT/cpp,dItot)
    13381339                  dItot = dItot + dItot_tmp
    13391340                  call planetwide_sumval(massarea(:,:)*zdqrain(:,:,igcm_h2o_vap)*ptimestep/totarea_planet,dVtot_tmp)
    1340                   call planetwide_sumval(area(:)*zdqsrain(:)/totarea_planet*RLVTT/cpp,dVtot)
     1341                  call planetwide_sumval(cell_area(:)*zdqsrain(:)/totarea_planet*RLVTT/cpp,dVtot)
    13411342                  dVtot = dVtot + dVtot_tmp
    13421343                  dEtot = dItot + dVtot
     
    13511352                  call planetwide_sumval(massarea(:,:)*zdqrain(:,:,igcm_h2o_vap)*ptimestep/totarea_planet+        &
    13521353                          massarea(:,:)*zdqrain(:,:,igcm_h2o_ice)*ptimestep/totarea_planet,dWtot)
    1353                   call planetwide_sumval((zdqsrain(:)+zdqssnow(:))*area(:)*ptimestep/totarea_planet,dWtots)
     1354                  call planetwide_sumval((zdqsrain(:)+zdqssnow(:))*cell_area(:)*ptimestep/totarea_planet,dWtots)
    13541355                 
    13551356                  if (is_master) then
     
    14071408            if(watertest)then
    14081409               call planetwide_sumval(massarea(:,:)*(zdqsed(:,:,igcm_h2o_vap)+zdqsed(:,:,igcm_h2o_ice))*ptimestep/totarea_planet,dWtot)
    1409                call planetwide_sumval((zdqssed(:,igcm_h2o_vap)+zdqssed(:,igcm_h2o_ice))*area(:)*ptimestep/totarea_planet,dWtots)
     1410               call planetwide_sumval((zdqssed(:,igcm_h2o_vap)+zdqssed(:,igcm_h2o_ice))*cell_area(:)*ptimestep/totarea_planet,dWtots)
    14101411               if (is_master) then
    14111412                        print*,'In sedim atmospheric ice change         =',dWtot,' kg m-2'
     
    15091510            ! Test energy conservation
    15101511            if(enertest)then
    1511                call planetwide_sumval(area(:)*capcal(:)*zdtsurf_hyd(:)/totarea_planet,dEtots)
     1512               call planetwide_sumval(cell_area(:)*capcal(:)*zdtsurf_hyd(:)/totarea_planet,dEtots)
    15121513               if (is_master) print*,'In hydrol surface energy change     =',dEtots,' W m-2'
    15131514            endif
     
    15151516            ! test water conservation
    15161517            if(watertest)then
    1517                call planetwide_sumval(dqs_hyd(:,igcm_h2o_ice)*area(:)*ptimestep/totarea_planet,dWtots)
     1518               call planetwide_sumval(dqs_hyd(:,igcm_h2o_ice)*cell_area(:)*ptimestep/totarea_planet,dWtots)
    15181519               if (is_master) print*,'In hydrol surface ice change            =',dWtots,' kg m-2'
    1519                   call planetwide_sumval(dqs_hyd(:,igcm_h2o_vap)*area(:)*ptimestep/totarea_planet,dWtots)
     1520                  call planetwide_sumval(dqs_hyd(:,igcm_h2o_vap)*cell_area(:)*ptimestep/totarea_planet,dWtots)
    15201521               if (is_master) then
    15211522                  print*,'In hydrol surface water change          =',dWtots,' kg m-2'
     
    15951596      ! Test energy conservation
    15961597      if(enertest)then
    1597          call planetwide_sumval(area(:)*capcal(:)*zdtsurf(:)/totarea_planet,dEtots)         
     1598         call planetwide_sumval(cell_area(:)*capcal(:)*zdtsurf(:)/totarea_planet,dEtots)         
    15981599         if (is_master) print*,'Surface energy change                 =',dEtots,' W m-2'
    15991600      endif
     
    16351636
    16361637      ! Surface and soil temperature information
    1637       call planetwide_sumval(area(:)*tsurf(:)/totarea_planet,Ts1)
     1638      call planetwide_sumval(cell_area(:)*tsurf(:)/totarea_planet,Ts1)
    16381639      call planetwide_minval(tsurf(:),Ts2)
    16391640      call planetwide_maxval(tsurf(:),Ts3)
    16401641      if(callsoil)then
    1641          TsS = SUM(area(:)*tsoil(:,nsoilmx))/totarea        ! mean temperature at bottom soil layer
     1642         TsS = SUM(cell_area(:)*tsoil(:,nsoilmx))/totarea        ! mean temperature at bottom soil layer
    16421643         print*,'  ave[Tsurf]     min[Tsurf]     max[Tsurf]     ave[Tdeep]'
    16431644         print*,Ts1,Ts2,Ts3,TsS
     
    16531654      if(corrk)then
    16541655
    1655          call planetwide_sumval(area(:)*fluxtop_dn(:)/totarea_planet,ISR)
    1656          call planetwide_sumval(area(:)*fluxabs_sw(:)/totarea_planet,ASR)
    1657          call planetwide_sumval(area(:)*fluxtop_lw(:)/totarea_planet,OLR)
    1658          call planetwide_sumval(area(:)*fluxgrd(:)/totarea_planet,GND)
    1659          call planetwide_sumval(area(:)*fluxdyn(:)/totarea_planet,DYN)
     1656         call planetwide_sumval(cell_area(:)*fluxtop_dn(:)/totarea_planet,ISR)
     1657         call planetwide_sumval(cell_area(:)*fluxabs_sw(:)/totarea_planet,ASR)
     1658         call planetwide_sumval(cell_area(:)*fluxtop_lw(:)/totarea_planet,OLR)
     1659         call planetwide_sumval(cell_area(:)*fluxgrd(:)/totarea_planet,GND)
     1660         call planetwide_sumval(cell_area(:)*fluxdyn(:)/totarea_planet,DYN)
    16601661         do ig=1,ngrid
    16611662            if(fluxtop_dn(ig).lt.0.0)then
     
    17491750      if(water)then
    17501751
    1751          call planetwide_sumval(area(:)*qsurf_hist(:,igcm_h2o_ice)/totarea_planet,icesrf)
    1752          call planetwide_sumval(area(:)*qsurf_hist(:,igcm_h2o_vap)/totarea_planet,liqsrf)
    1753          call planetwide_sumval(area(:)*qcol(:,igcm_h2o_ice)/totarea_planet,icecol)
    1754          call planetwide_sumval(area(:)*qcol(:,igcm_h2o_vap)/totarea_planet,vapcol)
     1752         call planetwide_sumval(cell_area(:)*qsurf_hist(:,igcm_h2o_ice)/totarea_planet,icesrf)
     1753         call planetwide_sumval(cell_area(:)*qsurf_hist(:,igcm_h2o_vap)/totarea_planet,liqsrf)
     1754         call planetwide_sumval(cell_area(:)*qcol(:,igcm_h2o_ice)/totarea_planet,icecol)
     1755         call planetwide_sumval(cell_area(:)*qcol(:,igcm_h2o_vap)/totarea_planet,vapcol)
    17551756
    17561757         h2otot = icesrf + liqsrf + icecol + vapcol
     
    18331834
    18341835            ! enforce ice conservation
    1835             ice_tot= SUM(qsurf_hist(:,igcm_h2o_ice)*area(:) )/SUM(area(:))
     1836            ice_tot= SUM(qsurf_hist(:,igcm_h2o_ice)*cell_area(:) )/SUM(cell_area(:))
    18361837            qsurf_hist(:,igcm_h2o_ice) = qsurf_hist(:,igcm_h2o_ice)*(icesrf/ice_tot)
    18371838
  • trunk/LMDZ.GENERIC/libf/phystd/rings.F90

    r1204 r1542  
    44! Authors: M. Sylvestre, M. Capderou, S. Guerlet, A. Spiga
    55
    6     use comdiurn_h
    7     use comgeomfi_h
     6    use comdiurn_h, only: sinlat, sinlon, coslat, coslon
     7    use comgeomphy, only: latitude ! (rad)
    88 
    99    implicit none   
     
    148148
    149149    ! Summer hemisphere is not under the shadow of the rings
    150     where(lati(:)*declin .gt. 0.)
     150    where(latitude(:)*declin .gt. 0.)
    151151       eclipse(:) = 1000.
    152152    end where
  • trunk/LMDZ.GENERIC/libf/phystd/soil.F

    r1529 r1542  
    88      use time_phylmdz_mod, only: daysec
    99      use planete_mod, only: year_day
    10       use comgeomfi_h, only: long, lati
     10      use comgeomphy, only: longitude, latitude ! in radians
    1111
    1212      implicit none
     
    133133        ! one should have the fist layer be at least half of diurnal skin depth
    134134          write(*,*) "soil Error: grid point ig=",ig
    135           write(*,*) "            longitude=",long(ig)*(180./pi)
    136           write(*,*) "             latitude=",lati(ig)*(180./pi)
     135          write(*,*) "            longitude=",longitude(ig)*(180./pi)
     136          write(*,*) "             latitude=",latitude(ig)*(180./pi)
    137137          write(*,*) "  first soil layer depth ",layer(1)
    138138          write(*,*) "  not small enough for a diurnal skin depth of ",
     
    144144        ! one should have the full soil be at least twice the diurnal skin depth
    145145          write(*,*) "soil Error: grid point ig=",ig
    146           write(*,*) "            longitude=",long(ig)*(180./pi)
    147           write(*,*) "             latitude=",lati(ig)*(180./pi)
     146          write(*,*) "            longitude=",longitude(ig)*(180./pi)
     147          write(*,*) "             latitude=",latitude(ig)*(180./pi)
    148148          write(*,*) "  total soil layer depth ",layer(nsoil)
    149149          write(*,*) "  not large enough for an annual skin depth of ",
  • trunk/LMDZ.GENERIC/libf/phystd/surface_nature.F

    r1397 r1542  
    44      USE surfdat_h
    55      USE comsoil_h
    6       USE comgeomfi_h
     6      USE comgeomphy, ONLY: cell_area
    77      USE tracer_h
    88
     
    5656        do ig=1,ngrid
    5757           if (rnat(ig).eq.0)then
    58               oceanarea=oceanarea+area(ig)
     58              oceanarea=oceanarea+cell_area(ig)
    5959           end if
    6060        enddo
  • trunk/LMDZ.GENERIC/libf/phystd/totalcloudfrac.F90

    r1397 r1542  
    33      use watercommon_h
    44      use comdiurn_h
    5       USE comgeomfi_h
    65      USE tracer_h, only: igcm_h2o_ice
    76      USE callkeys_mod, ONLY: CLFfixval
  • trunk/LMDZ.GENERIC/libf/phystd/vdifc.F

    r1477 r1542  
    1010      use radcommon_h, only : sigma
    1111      USE surfdat_h
    12       USE comgeomfi_h
    1312      USE tracer_h
    1413      use comcstfi_mod, only: g, r, cpp, rcp
  • trunk/LMDZ.GENERIC/libf/phystd/writediagfi.F

    r1531 r1542  
    4040!=================================================================
    4141      use surfdat_h, only: phisfi
    42       use comgeomphy, only: airephy
     42      use comgeomphy, only: cell_area
    4343      use time_phylmdz_mod, only: ecritphy, day_step, iphysiq, day_ini
    4444      USE mod_phys_lmdz_para, only : is_parallel, is_mpi_root,
     
    120120!Sortie des variables au rythme voulu
    121121
    122       irythme = int(ecritphy) ! sortie au rythme de ecritphy
    123 !     irythme = iconser  ! sortie au rythme des variables de controle
    124 !     irythme = iphysiq  ! sortie a tous les pas physique
    125 !     irythme = iecri*day_step ! sortie au rythme des fichiers histoires
    126 !     irythme = periodav*day_step ! sortie au rythme des fichiers histmoy
     122      irythme = int(ecritphy) ! output rate set by ecritphy
    127123
    128124!***************************************************************
     
    191187          ! Gather phisfi() geopotential on physics grid
    192188          call Gather(phisfi,phisfi_glo)
    193           ! Gather airephy() mesh area on physics grid
    194           call Gather(airephy,areafi_glo)
     189          ! Gather cell_area() mesh area on physics grid
     190          call Gather(cell_area,areafi_glo)
    195191#else
    196192         phisfi_glo(:)=phisfi(:)
    197          areafi_glo(:)=airephy(:)
     193         areafi_glo(:)=cell_area(:)
    198194#endif
    199195
     
    262258
    263259      endif ! if (firstnom.eq.'1234567890')
    264 
    265       if (klon_glo.eq.1) then
    266         ! in testphys1d, for the 1d version of the GCM, iphysiq and irythme
    267         ! are undefined; so set them to 1
    268         iphysiq=1
    269         irythme=1
    270       endif
    271260
    272261! Increment time index 'zitau' if it is the "fist call" (at given time level)
  • trunk/LMDZ.GENERIC/libf/phystd/writediagsoil.F90

    r1531 r1542  
    1313
    1414use comsoil_h, only: nsoilmx, inertiedat
    15 use comgeomphy, only: airephy
     15use comgeomphy, only: cell_area
    1616use time_phylmdz_mod, only: ecritphy, day_step, iphysiq
    1717use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
     
    102102   ! Gather inertiedat() soil thermal inertia on physics grid
    103103   call Gather(inertiedat,inertiafi_glo)
    104    ! Gather airephy() mesh area on physics grid
    105    call Gather(airephy,areafi_glo)
     104   ! Gather cell_area() mesh area on physics grid
     105   call Gather(cell_area,areafi_glo)
    106106#else
    107107         inertiafi_glo(:,:)=inertiedat(:,:)
    108          areafi_glo(:)=airephy(:)
     108         areafi_glo(:)=cell_area(:)
    109109#endif
    110110
  • trunk/LMDZ.GENERIC/libf/phystd/writediagspecIR.F

    r1531 r1542  
    4343! Addition by RW (2010) to allow OLR to be saved in .nc format
    4444      use radinc_h, only : L_NSPECTI
    45       use comgeomphy, only: airephy
     45      use comgeomphy, only: cell_area
    4646      use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
    4747      use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo,
     
    127127
    128128#ifdef CPP_PARA
    129           ! Gather airephy() mesh area on physics grid
    130           call Gather(airephy,areafi_glo)
    131 #else
    132          areafi_glo(:)=airephy(:)
     129          ! Gather cell_area() mesh area on physics grid
     130          call Gather(cell_area,areafi_glo)
     131#else
     132         areafi_glo(:)=cell_area(:)
    133133#endif
    134134         ! Create the NetCDF file
  • trunk/LMDZ.GENERIC/libf/phystd/writediagspecVI.F

    r1531 r1542  
    4343! Addition by RW (2010) to allow OSR to be saved in .nc format
    4444      use radinc_h, only : L_NSPECTV
    45       use comgeomphy, only: airephy
     45      use comgeomphy, only: cell_area
    4646      use mod_phys_lmdz_para, only : is_mpi_root, is_master, gather
    4747      use mod_grid_phy_lmdz, only : klon_glo, Grid1Dto2D_glo,
     
    126126
    127127#ifdef CPP_PARA
    128           ! Gather airephy() mesh area on physics grid
    129           call Gather(airephy,areafi_glo)
    130 #else
    131          areafi_glo(:)=airephy(:)
     128          ! Gather cell_area() mesh area on physics grid
     129          call Gather(cell_area,areafi_glo)
     130#else
     131         areafi_glo(:)=cell_area(:)
    132132#endif
    133133         ! Create the NetCDF file
Note: See TracChangeset for help on using the changeset viewer.