Changeset 3816 for dynamico_lmdz/aquaplanet/LMDZ5/libf/dynlonlat_phylonlat
- Timestamp:
- Apr 17, 2015, 9:51:15 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
dynamico_lmdz/aquaplanet/LMDZ5/libf/dynlonlat_phylonlat/phylmd/iniphysiq.F90
r3809 r3816 3 3 4 4 5 SUBROUTINE iniphysiq(ii m,jjm,nlayer,punjours, pdayref,ptimestep, &6 rlatu,rl onv,aire,cu,cv,&5 SUBROUTINE iniphysiq(ii,jj,nlayer,punjours, pdayref,ptimestep, & 6 rlatu,rlatv,rlonu,rlonv,aire,cu,cv, & 7 7 prad,pg,pr,pcpp,iflag_phys) 8 8 USE dimphy, ONLY: klev ! number of atmospheric levels … … 14 14 klon_mpi_begin ! start indes of columns (on local mpi grid) 15 15 USE comgeomphy, ONLY: initcomgeomphy, & 16 initcomgeomphy_vert, & 17 initcomgeomphy_horiz,& 16 18 airephy, & ! physics grid area (m2) 17 19 cuphy, & ! cu coeff. (u_covariant = cu * u) … … 19 21 rlond, & ! longitudes 20 22 rlatd ! latitudes 23 USE misc_mod, ONLY: debug 24 USE infotrac, ONLY: nqtot,nqo,nbtr,tname,ttext,type_trac,& 25 niadv,conv_flg,pbl_flg,solsym 26 USE phytrac_mod, ONLY: ini_phytrac_mod 27 USE control_mod, ONLY: dayref,anneeref,day_step,iphysiq,nday,& 28 config_inca,raz_date,offline 29 USE inifis_mod, ONLY: inifis 30 USE infotrac_phy, ONLY: init_infotrac_phy 21 31 USE phyaqua_mod, ONLY: iniaqua 22 32 IMPLICIT NONE … … 27 37 ! ======================================================================= 28 38 29 include "YOMCST.h" 39 ! include "YOMCST.h" 40 include "dimensions.h" 41 include "comvert.h" 42 include "comconst.h" 30 43 include "iniprint.h" 44 include "temps.h" 31 45 32 46 REAL, INTENT (IN) :: prad ! radius of the planet (m) … … 36 50 REAL, INTENT (IN) :: punjours ! length (in s) of a standard day 37 51 INTEGER, INTENT (IN) :: nlayer ! number of atmospheric layers 38 INTEGER, INTENT (IN) :: iim ! number of atmospheric columns along longitudes 39 INTEGER, INTENT (IN) :: jjm ! number of atompsheric columns along latitudes 40 REAL, INTENT (IN) :: rlatu(jjm+1) ! latitudes of the physics grid 41 REAL, INTENT (IN) :: rlonv(iim+1) ! longitudes of the physics grid 42 REAL, INTENT (IN) :: aire(iim+1,jjm+1) ! area of the dynamics grid (m2) 43 REAL, INTENT (IN) :: cu((iim+1)*(jjm+1)) ! cu coeff. (u_covariant = cu * u) 44 REAL, INTENT (IN) :: cv((iim+1)*jjm) ! cv coeff. (v_covariant = cv * v) 52 INTEGER, INTENT (IN) :: ii ! number of atmospheric columns along longitudes 53 INTEGER, INTENT (IN) :: jj ! number of atompsheric columns along latitudes 54 REAL, INTENT (IN) :: rlatu(jj+1) ! latitudes of the physics grid 55 REAL, INTENT (IN) :: rlatv(jj) ! latitude boundaries of the physics grid 56 REAL, INTENT (IN) :: rlonv(ii+1) ! longitudes of the physics grid 57 REAL, INTENT (IN) :: rlonu(ii+1) ! longitude boundaries of the physics grid 58 REAL, INTENT (IN) :: aire(ii+1,jj+1) ! area of the dynamics grid (m2) 59 REAL, INTENT (IN) :: cu((ii+1)*(jj+1)) ! cu coeff. (u_covariant = cu * u) 60 REAL, INTENT (IN) :: cv((ii+1)*jj) ! cv coeff. (v_covariant = cv * v) 45 61 INTEGER, INTENT (IN) :: pdayref ! reference day of for the simulation 46 62 REAL, INTENT (IN) :: ptimestep !physics time step (s) … … 70 86 END IF 71 87 72 !call init_phys_lmdz(ii m,jjm+1,llm,1,(/(jjm-1)*iim+2/))88 !call init_phys_lmdz(ii,jj+1,llm,1,(/(jj-1)*ii+2/)) 73 89 74 90 ! Generate global arrays on full physics grid … … 82 98 cufi(1) = cu(1) 83 99 cvfi(1) = cv(1) 84 DO j=2,jj m85 DO i=1,ii m86 latfi((j-2)*ii m+1+i)= rlatu(j)87 lonfi((j-2)*ii m+1+i)= rlonv(i)88 cufi((j-2)*ii m+1+i) = cu((j-1)*iim+1+i)89 cvfi((j-2)*ii m+1+i) = cv((j-1)*iim+1+i)100 DO j=2,jj 101 DO i=1,ii 102 latfi((j-2)*ii+1+i)= rlatu(j) 103 lonfi((j-2)*ii+1+i)= rlonv(i) 104 cufi((j-2)*ii+1+i) = cu((j-1)*ii+1+i) 105 cvfi((j-2)*ii+1+i) = cv((j-1)*ii+1+i) 90 106 ENDDO 91 107 ENDDO 92 108 ! South pole 93 latfi(klon_glo)= rlatu(jj m+1)109 latfi(klon_glo)= rlatu(jj+1) 94 110 lonfi(klon_glo)= 0. 95 cufi(klon_glo) = cu((ii m+1)*jjm+1)96 cvfi(klon_glo) = cv((ii m+1)*jjm-iim)111 cufi(klon_glo) = cu((ii+1)*jj+1) 112 cvfi(klon_glo) = cv((ii+1)*jj-ii) 97 113 98 114 ! build airefi(), mesh area on physics grid 99 CALL gr_dyn_fi(1,ii m+1,jjm+1,klon_glo,aire,airefi)115 CALL gr_dyn_fi(1,ii+1,jj+1,klon_glo,aire,airefi) 100 116 ! Poles are single points on physics grid 101 airefi(1)=sum(aire(1:ii m,1))102 airefi(klon_glo)=sum(aire(1:ii m,jjm+1))117 airefi(1)=sum(aire(1:ii,1)) 118 airefi(klon_glo)=sum(aire(1:ii,jj+1)) 103 119 104 120 ! Sanity check: do total planet area match between physics and dynamics? 105 total_area_dyn=sum(aire(1:ii m,1:jjm+1))121 total_area_dyn=sum(aire(1:ii,1:jj+1)) 106 122 total_area_phy=sum(airefi(1:klon_glo)) 107 123 IF (total_area_dyn/=total_area_phy) THEN … … 126 142 !$OMP PARALLEL 127 143 ! Now generate local lon/lat/cu/cv/area arrays 128 CALL initcomgeomphy 144 CALL initcomgeomphy(klon_omp) 129 145 130 146 offset = klon_mpi_begin - 1 … … 135 151 rlatd(1:klon_omp) = latfi(offset+klon_omp_begin:offset+klon_omp_end) 136 152 137 ! suphel => initialize some physical constants (orbital parameters, 138 ! geoid, gravity, thermodynamical constants, etc.) in the 139 ! physics 140 CALL suphel 153 ! copy over global grid longitudes and latitudes 154 CALL initcomgeomphy_horiz(iim,jjm,rlonu,rlonv,rlatu,rlatv) 155 156 ! copy over preff , ap(), bp(), etc 157 CALL initcomgeomphy_vert(nlayer,preff,ap,bp,presnivs,pseudoalt) 141 158 142 !$OMP END PARALLEL 159 ! ! suphel => initialize some physical constants (orbital parameters, 160 ! ! geoid, gravity, thermodynamical constants, etc.) in the 161 ! ! physics 162 ! CALL suphel 143 163 144 ! check that physical constants set in 'suphel' are coherent 145 ! with values set in the dynamics: 146 IF (rday/=punjours) THEN 147 WRITE (lunout, *) 'iniphysiq: length of day discrepancy!!!' 148 WRITE (lunout, *) ' in the dynamics punjours=', punjours 149 WRITE (lunout, *) ' but in the physics RDAY=', rday 150 IF (abs(rday-punjours)>0.01*punjours) THEN 151 ! stop here if the relative difference is more than 1% 152 abort_message = 'length of day discrepancy' 153 CALL abort_gcm(modname, abort_message, 1) 154 END IF 155 END IF 156 IF (rg/=pg) THEN 157 WRITE (lunout, *) 'iniphysiq: gravity discrepancy !!!' 158 WRITE (lunout, *) ' in the dynamics pg=', pg 159 WRITE (lunout, *) ' but in the physics RG=', rg 160 IF (abs(rg-pg)>0.01*pg) THEN 161 ! stop here if the relative difference is more than 1% 162 abort_message = 'gravity discrepancy' 163 CALL abort_gcm(modname, abort_message, 1) 164 END IF 165 END IF 166 IF (ra/=prad) THEN 167 WRITE (lunout, *) 'iniphysiq: planet radius discrepancy !!!' 168 WRITE (lunout, *) ' in the dynamics prad=', prad 169 WRITE (lunout, *) ' but in the physics RA=', ra 170 IF (abs(ra-prad)>0.01*prad) THEN 171 ! stop here if the relative difference is more than 1% 172 abort_message = 'planet radius discrepancy' 173 CALL abort_gcm(modname, abort_message, 1) 174 END IF 175 END IF 176 IF (rd/=pr) THEN 177 WRITE (lunout, *) 'iniphysiq: reduced gas constant discrepancy !!!' 178 WRITE (lunout, *) ' in the dynamics pr=', pr 179 WRITE (lunout, *) ' but in the physics RD=', rd 180 IF (abs(rd-pr)>0.01*pr) THEN 181 ! stop here if the relative difference is more than 1% 182 abort_message = 'reduced gas constant discrepancy' 183 CALL abort_gcm(modname, abort_message, 1) 184 END IF 185 END IF 186 IF (rcpd/=pcpp) THEN 187 WRITE (lunout, *) 'iniphysiq: specific heat discrepancy !!!' 188 WRITE (lunout, *) ' in the dynamics pcpp=', pcpp 189 WRITE (lunout, *) ' but in the physics RCPD=', rcpd 190 IF (abs(rcpd-pcpp)>0.01*pcpp) THEN 191 ! stop here if the relative difference is more than 1% 192 abort_message = 'specific heat discrepancy' 193 CALL abort_gcm(modname, abort_message, 1) 194 END IF 195 END IF 164 ! Initialize tracer names, numbers, etc. for physics 165 CALL ini_phytrac_phy(nqtot,nqo,nbtr,tname,ttext,type_trac,& 166 niadv,conv_flg,pbl_flg,solsym) 167 168 ! transfer some flags/infos from dynamics to physics 169 call inifis(punjours,prad,pg,pr,pcpp,ptimestep,& 170 day_step,iphysiq,dayref,anneeref,nday,& 171 annee_ref,day_ini,day_end,& 172 itau_phy,itaufin,& 173 start_time,day_ref,jD_ref, & 174 offline,raz_date,config_inca, & 175 lunout,prt_level,debug) 176 177 !!$OMP END PARALLEL 196 178 197 179 ! Additional initializations for aquaplanets 198 ! $OMP PARALLEL180 !!$OMP PARALLEL 199 181 IF (iflag_phys>=100) THEN 200 182 CALL iniaqua(klon_omp, rlatd, rlond, iflag_phys)
Note: See TracChangeset
for help on using the changeset viewer.
