- Timestamp:
- 10/30/15 15:41:06 (9 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/caldyn_hevi.f90
r362 r366 12 12 13 13 SUBROUTINE caldyn_hevi(write_out,tau, f_phis, f_ps, f_mass, f_theta_rhodz, f_u, f_q, & 14 f_geopot, f_hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du_slow, f_du_fast) 14 f_W, f_geopot, f_hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, & 15 f_du_slow, f_du_fast, f_dPhi_slow, f_dPhi_fast, f_dW_slow, f_dW_fast) 15 16 USE icosa 16 17 USE observable_mod … … 34 35 TYPE(t_field),POINTER :: f_u(:) 35 36 TYPE(t_field),POINTER :: f_q(:) 37 TYPE(t_field),POINTER :: f_W(:) 36 38 TYPE(t_field),POINTER :: f_geopot(:) 37 39 TYPE(t_field),POINTER :: f_hflux(:), f_wflux(:) … … 41 43 TYPE(t_field) :: f_du_slow(:) 42 44 TYPE(t_field) :: f_du_fast(:) 45 TYPE(t_field) :: f_dW_slow(:) 46 TYPE(t_field) :: f_dW_fast(:) 47 TYPE(t_field) :: f_dPhi_slow(:) 48 TYPE(t_field) :: f_dPhi_fast(:) 43 49 44 50 REAL(rstd),POINTER :: ps(:), dps(:) 45 51 REAL(rstd),POINTER :: mass(:,:), theta_rhodz(:,:), dtheta_rhodz(:,:) 46 REAL(rstd),POINTER :: du(:,:), hflux(:,:), wflux(:,:)47 REAL(rstd),POINTER :: u(:,:), qu(:,:), qv(:,:)52 REAL(rstd),POINTER :: du(:,:), dW(:,:), dPhi(:,:), hflux(:,:), wflux(:,:) 53 REAL(rstd),POINTER :: u(:,:), w(:,:), qu(:,:), qv(:,:) 48 54 49 55 ! temporary shared variable … … 68 74 CALL init_message(f_u,req_e1_vect,req_u) 69 75 CALL init_message(f_qu,req_e1_scal,req_qu) 76 IF(.NOT.hydrostatic) THEN 77 CALL init_message(f_geopot,req_i1,req_geopot) 78 CALL init_message(f_w,req_i1,req_w) 79 END IF 70 80 ENDIF 71 81 … … 81 91 CALL send_message(f_theta_rhodz,req_theta_rhodz) ! COM01 82 92 CALL wait_message(req_theta_rhodz) ! COM01 Moved from caldyn_pvort 93 94 IF(.NOT.hydrostatic) THEN 95 CALL send_message(f_geopot,req_geopot) ! COM03 96 CALL wait_message(req_geopot) ! COM03 97 CALL send_message(f_w,req_w) ! COM04 98 CALL wait_message(req_w) ! COM04 99 END IF 83 100 84 101 DO ind=1,ndomain … … 87 104 CALL swap_geometry(ind) 88 105 ps=f_ps(ind) 89 u=f_u(ind)90 du=f_du_fast(ind)91 106 theta_rhodz=f_theta_rhodz(ind) 92 107 mass=f_mass(ind) 93 108 theta = f_theta(ind) 109 CALL compute_theta(ps,theta_rhodz, mass,theta) 94 110 pk = f_pk(ind) 95 111 geopot = f_geopot(ind) 96 CALL compute_theta(ps,theta_rhodz, mass,theta) 97 CALL compute_geopot(ps,mass,theta, pk,geopot) 98 CALL compute_caldyn_fast(tau,u,mass,theta,pk,geopot, du) ! computes du_fast and updates u 112 IF(hydrostatic) THEN 113 CALL compute_geopot(ps,mass,theta, pk,geopot) 114 ELSE 115 W = f_W(ind) 116 dW = f_dW_fast(ind) 117 dPhi = f_dPhi_fast(ind) 118 CALL compute_caldyn_solver(tau,mass,theta,pk,geopot,W,dPhi,dW) ! computes d(Phi,W)_fast and updates Phi,W 119 END IF 120 u=f_u(ind) 121 du=f_du_fast(ind) 122 CALL compute_caldyn_fast(tau,u,mass,theta,pk,geopot,du) ! computes du_fast and updates du 99 123 ENDDO 100 124 -
codes/icosagcm/trunk/src/caldyn_kernels_base.f90
r362 r366 18 18 !$OMP THREADPRIVATE(caldyn_conserv) 19 19 20 TYPE(t_message),PUBLIC :: req_ps, req_mass, req_theta_rhodz, req_u, req_qu 20 TYPE(t_message),PUBLIC :: req_ps, req_mass, req_theta_rhodz, req_u, req_qu, req_geopot, req_w 21 21 22 22 PUBLIC :: compute_geopot, compute_caldyn_vert … … 51 51 52 52 IF(caldyn_eta==eta_mass .AND. .NOT. DEC) THEN 53 54 53 !!! Compute exner function and geopotential 55 54 DO l = 1,llm … … 64 63 ENDDO 65 64 ELSE 66 ! We are using a Lagrangian vertical coordinate67 ! Pressure must becomputed first top-down (temporarily stored in pk)65 ! We are using DEC or a Lagrangian vertical coordinate 66 ! Pressure is computed first top-down (temporarily stored in pk) 68 67 ! Then Exner pressure and geopotential are computed bottom-up 69 ! Notice that the computation below should workalso when caldyn_eta=eta_mass68 ! Works also when caldyn_eta=eta_mass 70 69 71 70 IF(boussinesq) THEN ! compute geopotential and pk=Lagrange multiplier -
codes/icosagcm/trunk/src/caldyn_kernels_hevi.f90
r362 r366 6 6 PRIVATE 7 7 8 PUBLIC :: compute_theta, compute_pvort_only, compute_caldyn_fast, compute_caldyn_slow 8 PUBLIC :: compute_theta, compute_pvort_only, compute_caldyn_slow, & 9 compute_caldyn_solver, compute_caldyn_fast 9 10 10 11 CONTAINS … … 120 121 END SUBROUTINE compute_pvort_only 121 122 122 SUBROUTINE compute_caldyn_fast(tau,u,rhodz,theta,pk,geopot, du) 123 SUBROUTINE compute_caldyn_solver(tau,rhodz,theta,pk, geopot,W, dPhi,dW) 124 USE icosa 125 USE disvert_mod 126 USE exner_mod 127 USE trace 128 USE omp_para 129 USE disvert_mod 130 IMPLICIT NONE 131 REAL(rstd),INTENT(IN) :: tau ! "solve" Phi-tau*dPhi/dt = Phi_rhs 132 REAL(rstd),INTENT(IN) :: rhodz(iim*jjm,llm) 133 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm) 134 REAL(rstd),INTENT(OUT) :: pk(iim*jjm,llm) 135 REAL(rstd),INTENT(INOUT) :: geopot(iim*jjm,llm+1) 136 REAL(rstd),INTENT(INOUT) :: W(iim*jjm,llm+1) ! OUT if tau>0 137 REAL(rstd),INTENT(OUT) :: dW(iim*jjm,llm+1) 138 REAL(rstd),INTENT(OUT) :: dPhi(iim*jjm,llm+1) 139 140 INTEGER :: ij,l 141 INTEGER :: ij_omp_begin_ext, ij_omp_end_ext 142 REAL(rstd) :: gamma, rho_ij, X_ij, Y_ij, m_il 143 144 CALL trace_start("compute_caldyn_solver") 145 146 CALL distrib_level(ij_end_ext-ij_begin_ext+1,ij_omp_begin_ext,ij_omp_end_ext) 147 ij_omp_begin_ext=ij_omp_begin_ext+ij_begin_ext-1 148 ij_omp_end_ext=ij_omp_end_ext+ij_begin_ext-1 149 150 IF(tau>0) THEN 151 PRINT *, 'No implicit solver for NH yet' 152 STOP 153 END IF 154 155 ! Compute pressure, stored temporarily in pk 156 ! kappa = R/Cp 157 ! 1-kappa = Cv/Cp 158 ! Cp/Cv = 1/(1-kappa) 159 gamma = 1./(1.-kappa) 160 DO l=ll_begin,ll_end 161 !DIR$ SIMD 162 DO ij=ij_omp_begin_ext,ij_omp_end_ext 163 rho_ij = (g*rhodz(ij,l))/(geopot(ij,l+1)-geopot(ij,l)) 164 X_ij = (cpp/preff)*kappa*theta(ij,l)*rho_ij 165 ! kappa.theta.rho = p/exner 166 ! => X = (p/p0)/(exner/Cp) 167 ! = (p/p0)^(1-kappa) 168 pk(ij,l) = preff*(X_ij**gamma) 169 ENDDO 170 ENDDO 171 172 ! Compute tendencies for geopotential and vertical momentum 173 DO l=ll_beginp1,ll_end 174 !DIR$ SIMD 175 DO ij=ij_omp_begin_ext,ij_omp_end_ext 176 m_il = .5*(rhodz(ij,l)+rhodz(ij,l-1)) 177 dW(ij,l) = (1./g)*(pk(ij,l-1)-pk(ij,l)) - m_il 178 dPhi(ij,l) = g*g*W(ij,l)/m_il 179 ENDDO 180 ! PRINT *,'Max dPhi', l,ij_begin,ij_end, MAXVAL(abs(dPhi(ij_begin:ij_end,l))) 181 ! PRINT *,'Max dW', l,ij_begin,ij_end, MAXVAL(abs(dW(ij_begin:ij_end,l))) 182 ENDDO 183 ! Lower BC (FIXME : no orography yet !) 184 DO ij=ij_begin,ij_end 185 dPhi(ij,1)=0 186 W(ij,1)=0 187 dW(ij,1)=0 188 dPhi(ij,llm+1)=0 ! rigid lid 189 W(ij,llm+1)=0 190 dW(ij,llm+1)=0 191 ENDDO 192 ! Upper BC p=ptop 193 ! DO ij=ij_omp_begin_ext,ij_omp_end_ext 194 ! dPhi(ij,llm+1) = W(ij,llm+1)/rhodz(ij,llm) 195 ! dW(ij,llm+1) = (1./g)*(pk(ij,llm)-ptop) - .5*rhodz(ij,llm) 196 ! ENDDO 197 198 ! Compute Exner function (needed by compute_caldyn_fast) 199 DO l=ll_begin,ll_end 200 !DIR$ SIMD 201 DO ij=ij_omp_begin_ext,ij_omp_end_ext 202 pk(ij,l) = cpp*((pk(ij,l)/preff)**kappa) ! other formulae possible if exponentiation is slow 203 ENDDO 204 ENDDO 205 206 CALL trace_end("compute_caldyn_solver") 207 208 END SUBROUTINE compute_caldyn_solver 209 210 SUBROUTINE compute_caldyn_fast(tau,u,rhodz,theta,pk,geopot,du) 123 211 USE icosa 124 212 USE disvert_mod … … 127 215 USE omp_para 128 216 IMPLICIT NONE 129 REAL(rstd), INTENT(IN) :: tau! "solve" u-tau*du/dt = rhs130 REAL(rstd),INTENT(INOUT) :: u(iim*3*jjm,llm) ! prognostic "velocity"131 REAL(rstd),INTENT(IN) :: rhodz(iim*jjm,llm)132 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm) ! potential temperature133 REAL(rstd),INTENT(INOUT) :: pk(iim*jjm,llm) ! Exner function134 REAL(rstd),INTENT(IN ) :: geopot(iim*jjm,llm+1) ! geopotential135 REAL(rstd),INTENT(OUT) :: du(iim*3*jjm,llm)217 REAL(rstd),INTENT(IN) :: tau ! "solve" u-tau*du/dt = rhs 218 REAL(rstd),INTENT(INOUT) :: u(iim*3*jjm,llm) ! OUT if tau>0 219 REAL(rstd),INTENT(IN) :: rhodz(iim*jjm,llm) 220 REAL(rstd),INTENT(IN) :: theta(iim*jjm,llm) 221 REAL(rstd),INTENT(INOUT) :: pk(iim*jjm,llm) 222 REAL(rstd),INTENT(INOUT) :: geopot(iim*jjm,llm+1) 223 REAL(rstd),INTENT(OUT) :: du(iim*3*jjm,llm) 136 224 REAL(rstd) :: berni(iim*jjm,llm) ! Bernoulli function 137 225 … … 140 228 141 229 CALL trace_start("compute_caldyn_fast") 142 143 ! Compute bernouilli term230 231 ! Compute Bernoulli term 144 232 IF(boussinesq) THEN 233 145 234 DO l=ll_begin,ll_end 146 235 !DIR$ SIMD -
codes/icosagcm/trunk/src/dcmip_initial_conditions_test_1_2_3_v5.f90
r186 r366 1203 1203 !----------------------------------------------------------------------- 1204 1204 1205 real(rstd), intent(in) :: lon, & 1206 lat, &! Latitude (radians)1207 z ! Height (m) 1208 1209 real(rstd), intent(inout) :: p ! Pressure (Pa)1210 1205 real(rstd), intent(in) :: lon, & ! Longitude (radians) 1206 lat ! Latitude (radians) 1207 1208 real(rstd), intent(inout) :: p, & ! Pressure (Pa) 1209 z ! Height (m) 1210 1211 1211 1212 1212 integer, intent(in) :: zcoords ! 0 or 1 see below 1213 1213 1214 real(rstd), intent(out) :: u, & 1214 real(rstd), intent(out) :: u, & ! Zonal wind (m s^-1) 1215 1215 v, & ! Meridional wind (m s^-1) 1216 1216 w, & ! Vertical Velocity (m s^-1) … … 1230 1230 Om = 0.d0, & ! Rotation Rate of Earth 1231 1231 as = a/X, & ! New Radius of small Earth 1232 u0 = 20.d0, & ! Reference Velocity 1232 ! u0 = 20.d0, & ! Reference Velocity 1233 u0 = 0.d0, & ! FIXME : no zonal wind for NH tests 1233 1234 Teq = 300.d0, & ! Temperature at Equator 1234 1235 Peq = 100000.d0, & ! Reference PS at Equator … … 1297 1298 1298 1299 height = (-g/N2)*log( (TS/bigG)*( (p/ps)**(Rd/cp) - 1.d0 ) + 1.d0 ) 1300 z = height ! modified : initialize z when pressure-based 1299 1301 1300 1302 endif -
codes/icosagcm/trunk/src/earth_const.f90
r266 r366 16 16 REAL(rstd),SAVE :: mu ! molar mass of the atmosphere 17 17 18 LOGICAL, SAVE :: boussinesq 18 LOGICAL, SAVE :: boussinesq, hydrostatic 19 19 20 20 CONTAINS … … 34 34 CALL getin("scale_height",scale_height) 35 35 36 mu=kappa/cpp37 36 boussinesq=.FALSE. 38 37 CALL getin("boussinesq",boussinesq) 38 hydrostatic=.TRUE. 39 CALL getin("hydrostatic",hydrostatic) 40 IF(boussinesq .AND. .NOT. hydrostatic) THEN 41 PRINT *, 'boussinesq=.TRUE. and hydrostatic=.FALSE. : Non-hydrostatic boussinesq equations are not supported' 42 STOP 43 END IF 39 44 45 mu=kappa/cpp 40 46 radius=radius/scale_factor 41 47 omega=omega*scale_factor … … 45 51 46 52 END MODULE earth_const 47 -
codes/icosagcm/trunk/src/etat0.f90
r353 r366 13 13 CONTAINS 14 14 15 SUBROUTINE etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_ q)15 SUBROUTINE etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_geopot,f_w, f_q) 16 16 USE mpipara, ONLY : is_mpi_root 17 17 USE disvert_mod … … 35 35 TYPE(t_field),POINTER :: f_theta_rhodz(:) 36 36 TYPE(t_field),POINTER :: f_u(:) 37 TYPE(t_field),POINTER :: f_geopot(:) 38 TYPE(t_field),POINTER :: f_w(:) 37 39 TYPE(t_field),POINTER :: f_q(:) 38 40 39 41 REAL(rstd),POINTER :: ps(:), mass(:,:) 40 LOGICAL :: init_mass, collocated42 LOGICAL :: autoinit_mass, autoinit_geopot, collocated 41 43 INTEGER :: ind,i,j,ij,l 42 44 … … 45 47 ! the initial distribution of mass is taken to be the same 46 48 ! as what the mass coordinate would dictate 47 ! however if etat0_XXX defines mass then the flag init_mass must be set to .FALSE.49 ! however if etat0_XXX defines mass then the flag autoinit_mass must be set to .FALSE. 48 50 ! otherwise mass will be overwritten 49 init_mass = (caldyn_eta == eta_lag)51 autoinit_mass = (caldyn_eta == eta_lag) 50 52 51 53 etat0_type='jablonowsky06' … … 70 72 CALL getin_etat0_dcmip5 71 73 CASE ('williamson91.6') 72 init_mass=.FALSE.74 autoinit_mass=.FALSE. 73 75 CALL getin_etat0_williamson 74 76 CASE DEFAULT 75 77 collocated=.FALSE. 78 autoinit_mass = .FALSE. 76 79 END SELECT 77 80 … … 90 93 CASE DEFAULT 91 94 IF(collocated) THEN 92 CALL etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_ q)95 CALL etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_geopot,f_W, f_q) 93 96 ELSE 94 97 PRINT*, 'Bad selector for variable etat0 <',etat0_type, & … … 98 101 END SELECT 99 102 100 IF(init_mass) THEN ! initialize mass distribution using ps101 103 ! !$OMP BARRIER 104 IF(autoinit_mass) THEN 102 105 DO ind=1,ndomain 103 106 IF (.NOT. assigned_domain(ind)) CYCLE … … 105 108 CALL swap_geometry(ind) 106 109 mass=f_mass(ind); ps=f_ps(ind) 107 CALL compute_rhodz(.TRUE., ps, mass) 110 CALL compute_rhodz(.TRUE., ps, mass) ! initialize mass distribution using ps 108 111 END DO 109 112 END IF 110 113 111 114 END SUBROUTINE etat0 112 115 113 SUBROUTINE etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_ q)116 SUBROUTINE etat0_collocated(f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_geopot,f_W, f_q) 114 117 USE theta2theta_rhodz_mod 115 118 IMPLICIT NONE … … 119 122 TYPE(t_field),POINTER :: f_theta_rhodz(:) 120 123 TYPE(t_field),POINTER :: f_u(:) 124 TYPE(t_field),POINTER :: f_geopot(:) 125 TYPE(t_field),POINTER :: f_W(:) 121 126 TYPE(t_field),POINTER :: f_q(:) 122 127 … … 128 133 REAL(rstd),POINTER :: temp(:,:) 129 134 REAL(rstd),POINTER :: u(:,:) 135 REAL(rstd),POINTER :: geopot(:,:) 136 REAL(rstd),POINTER :: W(:,:) 130 137 REAL(rstd),POINTER :: q(:,:,:) 131 138 INTEGER :: ind … … 143 150 temp=f_temp(ind) 144 151 u=f_u(ind) 152 geopot=f_geopot(ind) 153 w=f_w(ind) 145 154 q=f_q(ind) 146 155 147 IF( TRIM(etat0_type)=='williamson91.6' ) THEN 148 CALL compute_etat0_collocated(ps,mass, phis, theta_rhodz, u, q)156 IF( TRIM(etat0_type)=='williamson91.6' ) THEN 157 CALL compute_etat0_collocated(ps,mass, phis, theta_rhodz, u, geopot, W, q) 149 158 ELSE 150 CALL compute_etat0_collocated(ps,mass, phis, temp, u, q)159 CALL compute_etat0_collocated(ps,mass, phis, temp, u, geopot, W, q) 151 160 ENDIF 152 161 ENDDO … … 158 167 END SUBROUTINE etat0_collocated 159 168 160 SUBROUTINE compute_etat0_collocated(ps,mass, phis, temp_i, u, q)169 SUBROUTINE compute_etat0_collocated(ps,mass,phis,temp_i,u, geopot,W, q) 161 170 USE wind_mod 171 USE disvert_mod 162 172 USE etat0_jablonowsky06_mod, ONLY : compute_jablonowsky06 => compute_etat0 163 173 USE etat0_dcmip1_mod, ONLY : compute_dcmip1 => compute_etat0 … … 174 184 REAL(rstd),INTENT(OUT) :: temp_i(iim*jjm,llm) 175 185 REAL(rstd),INTENT(OUT) :: u(3*iim*jjm,llm) 186 REAL(rstd),INTENT(OUT) :: W(iim*jjm,llm+1) 187 REAL(rstd),INTENT(OUT) :: geopot(iim*jjm,llm+1) 176 188 REAL(rstd),INTENT(OUT) :: q(iim*jjm,llm,nqtot) 177 189 … … 183 195 REAL(rstd) :: phis_e(3*iim*jjm) 184 196 REAL(rstd) :: temp_e(3*iim*jjm,llm) 197 REAL(rstd) :: geopot_e(3*iim*jjm,llm+1) 185 198 REAL(rstd) :: ulon_e(3*iim*jjm,llm) 186 199 REAL(rstd) :: ulat_e(3*iim*jjm,llm) … … 188 201 189 202 INTEGER :: l,i,j,ij 203 REAL :: p_ik, v_ik, mass_ik 204 LOGICAL :: autoinit_mass, autoinit_NH 205 206 ! For NH geopotential and vertical momentum must be initialized. 207 ! Unless autoinit_mass is set to .FALSE. , they will be initialized 208 ! to hydrostatic geopotential and zero 209 autoinit_mass = .TRUE. 210 autoinit_NH = .NOT. hydrostatic 211 w(:,:) = 0 190 212 191 213 !$OMP BARRIER … … 208 230 CALL compute_dcmip2(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e) 209 231 CASE('dcmip3') 210 CALL compute_dcmip3(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) 211 CALL compute_dcmip3(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, q_e) 232 CALL compute_dcmip3(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, geopot, q) 233 CALL compute_dcmip3(3*iim*jjm,lon_e,lat_e, phis_e, ps_e, temp_e, ulon_e, ulat_e, geopot_e, q_e) 234 autoinit_NH = .FALSE. ! compute_dcmip3 initializes geopot 212 235 CASE('dcmip4') 213 236 CALL compute_dcmip4(iim*jjm,lon_i,lat_i, phis, ps, temp_i, ulon_i, ulat_i, q) … … 219 242 CALL compute_w91_6(iim*jjm,lon_i,lat_i, phis, mass(:,1), temp_i(:,1), ulon_i(:,1), ulat_i(:,1)) 220 243 CALL compute_w91_6(3*iim*jjm,lon_e,lat_e, phis_e, mass_e(:,1), temp_e(:,1), ulon_e(:,1), ulat_e(:,1)) 244 autoinit_mass = .FALSE. ! do not overwrite mass 221 245 END SELECT 246 247 IF(autoinit_mass) CALL compute_rhodz(.TRUE., ps, mass) ! initialize mass distribution using ps 248 IF(autoinit_NH) THEN 249 geopot(:,1) = phis(:) ! surface geopotential 250 DO l = 1, llm 251 DO ij=1,iim*jjm 252 ! hybrid pressure coordinate 253 p_ik = ptop + mass_ak(l) + mass_bk(l)*ps(ij) 254 mass_ik = (mass_dak(l) + mass_dbk(l)*ps(ij))/g 255 ! v=R.T/p, R=kappa*cpp 256 v_ik = kappa*cpp*temp_i(ij,l)/p_ik 257 geopot(ij,l+1) = geopot(ij,l) + mass_ik*v_ik*g 258 END DO 259 END DO 260 END IF 222 261 223 262 !$OMP BARRIER -
codes/icosagcm/trunk/src/etat0_dcmip3.f90
r356 r366 7 7 CONTAINS 8 8 9 SUBROUTINE compute_etat0(ngrid,lon,lat, phis,ps,temp,ulon,ulat, q)9 SUBROUTINE compute_etat0(ngrid,lon,lat, phis,ps,temp,ulon,ulat,geopot,q) 10 10 USE genmod 11 11 USE dcmip_initial_conditions_test_1_2_3 … … 20 20 REAL(rstd), INTENT(OUT) :: ulat(ngrid,llm) 21 21 REAL(rstd), INTENT(OUT) :: temp(ngrid,llm) 22 REAL(rstd), INTENT(OUT) :: geopot(ngrid,llm+1) 22 23 REAL(rstd), INTENT(OUT) :: q(ngrid,llm,nqtot) 23 24 REAL(rstd),PARAMETER :: Peq=1e5 ! Reference surface pressure at the equator (hPa) 24 REAL(rstd) :: dummy, pp 25 REAL(rstd) :: dummy, pp, zz 25 26 INTEGER :: l,ij 26 27 pp=peq … … 28 29 CALL test3_gravity_wave(lon(ij),lat(ij),pp,dummy,0, & 29 30 dummy,dummy,dummy,dummy,phis(ij),ps(ij),dummy,dummy) 31 END DO 32 DO l=ll_begin,ll_endp1 33 DO ij=1,ngrid 34 pp = ap(l) + bp(l)*ps(ij) ! half-layer pressure 35 CALL test3_gravity_wave(lon(ij),lat(ij),pp,zz,0, & 36 dummy,dummy,dummy,dummy,dummy,dummy,dummy,dummy) 37 geopot(ij,l) = g*zz ! initialize geopotential for NH 38 END DO 39 q(:,l,:)=0. 30 40 END DO 31 41 DO l=ll_begin,ll_end -
codes/icosagcm/trunk/src/euler_scheme.f90
r362 r366 5 5 6 6 TYPE(t_field),POINTER,SAVE,PUBLIC :: f_geopot(:), f_q(:), & 7 f_rhodz(:), f_mass(:), f_massm1(:), f_massm2(:), f_dmass(:), & 8 f_phis(:), f_ps(:),f_psm1(:), f_psm2(:), f_dps(:), & 9 f_u(:),f_um1(:),f_um2(:), f_du(:), & ! previous state 10 f_theta_rhodz(:),f_theta_rhodzm1(:),f_theta_rhodzm2(:), f_dtheta_rhodz(:), & ! trends 11 f_hflux(:), f_wflux(:), f_hfluxt(:), f_wfluxt(:), & ! accumulated mass fluxes 12 ! slow/fast trend arrays for HEVI time scheme 13 f_dmass_slow(:,:), f_dps_slow(:,:), f_dtheta_rhodz_slow(:,:), & 14 f_du_slow(:,:), f_du_fast(:,:) 7 f_rhodz(:), f_mass(:), f_massm1(:), f_massm2(:), f_dmass(:), & ! current and previous time steps + tendency of mass, 8 f_phis(:), f_ps(:),f_psm1(:), f_psm2(:), f_dps(:), & ! column-integrated mass 9 f_u(:),f_um1(:),f_um2(:), f_du(:), f_W(:), & ! 'horizontal' and vertical (NH) momentum 10 f_theta_rhodz(:),f_theta_rhodzm1(:),f_theta_rhodzm2(:), f_dtheta_rhodz(:), & ! mass-weighted theta/entropy 11 f_hflux(:), f_wflux(:), f_hfluxt(:), f_wfluxt(:), & ! accumulated mass fluxes 12 f_du_slow(:,:), f_du_fast(:,:), & ! slow/fast trend arrays 13 f_dmass_slow(:,:), f_dps_slow(:,:), f_dtheta_rhodz_slow(:,:), &! for HEVI time scheme 14 f_dPhi_slow(:,:), f_dPhi_fast(:,:), & ! geopotential tendencies (NH) 15 f_dW_slow(:,:), f_dW_fast(:,:) ! vertical momentum tendencies (NH) 15 16 16 17 INTEGER, PARAMETER, PUBLIC :: explicit=1, hevi=2, euler=1, rk4=2, mlf=3, rk25=4, ark23=6, ark33=7 -
codes/icosagcm/trunk/src/hevi_scheme.f90
r362 r366 28 28 SUBROUTINE set_coefs_ark33(dt) 29 29 ! Fully-explicit RK3 scheme disguised as ARK 30 ! To check correctness of caldyn_hevi31 30 REAL(rstd) :: dt 32 REAL(rstd), PARAMETER, DIMENSION(3,4) :: & 33 ajl=(/ zero, (/.5,0.,0./), (/-1.,2.,0./), (/1./6.,2./3.,1./6./) /) 34 CALL set_coefs_hevi(dt, ajl, ajl) 31 CALL set_coefs_rk(dt, (/ zero, (/.5,0.,0./), (/-1.,2.,0./), (/1./6.,2./3.,1./6./) /) ) 35 32 END SUBROUTINE set_coefs_ark33 36 33 34 SUBROUTINE set_coefs_rk(dt, ajl) 35 REAL(rstd) :: dt, ajl(3,4) 36 CALL set_coefs_hevi(dt,ajl,ajl) 37 END SUBROUTINE set_coefs_rk 38 37 39 SUBROUTINE set_coefs_hevi(dt, ajl_slow, ajl_fast) 38 40 REAL(rstd) :: dt, ajl_slow(3,4), ajl_fast(3,4) ! fast/slow Butcher tableaus … … 58 60 CALL caldyn_hevi((j==1) .AND. (MOD(it,itau_out)==0), taujj(j), & 59 61 f_phis, f_ps,f_mass,f_theta_rhodz,f_u,f_q, & 60 f_ geopot, f_hflux, f_wflux, &62 f_W, f_geopot, f_hflux, f_wflux, & 61 63 f_dps_slow(:,j), f_dmass_slow(:,j), f_dtheta_rhodz_slow(:,j), & 62 f_du_slow(:,j), f_du_fast(:,j) ) 64 f_du_slow(:,j), f_du_fast(:,j), & 65 f_dPhi_slow(:,j), f_dPhi_fast(:,j), & 66 f_dW_slow(:,j), f_dW_fast(:,j) ) 63 67 ! accumulate mass fluxes for transport scheme 64 68 DO ind=1,ndomain … … 79 83 CALL update(bjl(l,j), f_u, f_du_slow(:,l)) 80 84 CALL update(cjl(l,j), f_u, f_du_fast(:,l)) 85 IF(.NOT. hydrostatic) THEN 86 ! CALL update(bjl(l,j), f_W, f_dW_slow(:,l)) ! slow tendencies of w, Phi not implemented yet 87 CALL update(cjl(l,j), f_W, f_dW_fast(:,l)) 88 ! CALL update(bjl(l,j), f_geopot, f_dPhi_slow(:,l)) 89 CALL update(cjl(l,j), f_geopot, f_dPhi_fast(:,l)) 90 END IF 81 91 END DO 82 92 END DO -
codes/icosagcm/trunk/src/timeloop_gcm.f90
r365 r366 76 76 CALL allocate_field(f_phis,field_t,type_real,name='phis') 77 77 ! Model state at current time step 78 CALL allocate_field(f_geopot,field_t,type_real,llm+1,name='geopot')79 78 CALL allocate_field(f_ps,field_t,type_real, name='ps') 80 79 CALL allocate_field(f_mass,field_t,type_real,llm,name='mass') … … 82 81 CALL allocate_field(f_theta_rhodz,field_t,type_real,llm,name='theta_rhodz') 83 82 CALL allocate_field(f_u,field_u,type_real,llm,name='u') 83 CALL allocate_field(f_geopot,field_t,type_real,llm+1,name='geopot') 84 CALL allocate_field(f_W,field_t,type_real,llm+1,name='W') 84 85 CALL allocate_field(f_q,field_t,type_real,llm,nqtot,'q') 85 86 ! Mass fluxes … … 108 109 CALL allocate_fields(nb_stage,f_du_slow, field_u,type_real,llm,name='du_slow') 109 110 CALL allocate_fields(nb_stage,f_du_fast, field_u,type_real,llm,name='du_fast') 111 CALL allocate_fields(nb_stage,f_dW_slow, field_t,type_real,llm+1,name='dW_slow') 112 CALL allocate_fields(nb_stage,f_dW_fast, field_t,type_real,llm+1,name='dW_fast') 113 CALL allocate_fields(nb_stage,f_dPhi_slow, field_t,type_real,llm+1,name='dPhi_slow') 114 CALL allocate_fields(nb_stage,f_dPhi_fast, field_t,type_real,llm+1,name='dPhi_fast') 110 115 f_dps => f_dps_slow(:,1) 111 116 f_du => f_du_slow(:,1) … … 131 136 CALL init_check_conserve 132 137 133 CALL etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_ q)138 CALL etat0(f_ps,f_mass,f_phis,f_theta_rhodz,f_u, f_geopot,f_W, f_q) 134 139 135 140 CALL transfert_request(f_phis,req_i0)
Note: See TracChangeset
for help on using the changeset viewer.