Changeset 387
- Timestamp:
- 05/28/16 00:32:21 (8 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 12 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/caldyn_gcm.f90
r362 r387 133 133 134 134 REAL(rstd),POINTER :: ps(:), dps(:) 135 REAL(rstd),POINTER :: mass(:,:), theta_rhodz(:,: ), dtheta_rhodz(:,:)135 REAL(rstd),POINTER :: mass(:,:), theta_rhodz(:,:,:), dtheta_rhodz(:,:,:) 136 136 REAL(rstd),POINTER :: u(:,:), du(:,:), hflux(:,:), wflux(:,:) 137 137 REAL(rstd),POINTER :: qu(:,:) … … 194 194 qu=f_qu(ind) 195 195 qv=f_qv(ind) 196 CALL compute_pvort(ps,u,theta_rhodz , mass,theta,qu,qv) ! COM00 COM01 COM02196 CALL compute_pvort(ps,u,theta_rhodz(:,:,1), mass,theta,qu,qv) ! COM00 COM01 COM02 197 197 ENDDO 198 198 ! CALL checksum(f_mass) … … 208 208 ps=f_ps(ind) 209 209 u=f_u(ind) 210 theta_rhodz=f_theta_rhodz(ind)211 210 mass=f_mass(ind) 212 211 theta = f_theta(ind) … … 219 218 dtheta_rhodz=f_dtheta_rhodz(ind) 220 219 du=f_du(ind) 221 CALL compute_caldyn_horiz(u,mass,qu,theta,pk,geopot, hflux,convm,dtheta_rhodz ,du)220 CALL compute_caldyn_horiz(u,mass,qu,theta,pk,geopot, hflux,convm,dtheta_rhodz(:,:,1),du) 222 221 IF(caldyn_eta==eta_mass) THEN 223 222 wflux=f_wflux(ind) 224 223 wwuu=f_wwuu(ind) 225 224 dps=f_dps(ind) 226 CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz , du)225 CALL compute_caldyn_vert(u,theta,mass,convm, wflux,wwuu, dps, dtheta_rhodz(:,:,1), du) 227 226 END IF 228 227 ENDDO … … 245 244 qu=f_qu(ind) 246 245 qv=f_qv(ind) 247 CALL compute_pvort(ps,u,theta_rhodz , mass,theta,qu,qv)246 CALL compute_pvort(ps,u,theta_rhodz(:,:,1), mass,theta,qu,qv) 248 247 pk = f_pk(ind) 249 248 geopot = f_geopot(ind) … … 253 252 dtheta_rhodz=f_dtheta_rhodz(ind) 254 253 du=f_du(ind) 255 CALL compute_caldyn_horiz(u,mass,qu,theta,pk,geopot, hflux,convm,dtheta_rhodz ,du)254 CALL compute_caldyn_horiz(u,mass,qu,theta,pk,geopot, hflux,convm,dtheta_rhodz(:,:,1),du) 256 255 IF(caldyn_eta==eta_mass) THEN 257 256 wflux=f_wflux(ind) -
codes/icosagcm/trunk/src/caldyn_hevi.f90
r377 r387 49 49 50 50 REAL(rstd),POINTER :: ps(:), dps(:) 51 REAL(rstd),POINTER :: mass(:,:), theta_rhodz(:,: ), dtheta_rhodz(:,:)51 REAL(rstd),POINTER :: mass(:,:), theta_rhodz(:,:,:), dtheta_rhodz(:,:,:) 52 52 REAL(rstd),POINTER :: du(:,:), dW(:,:), dPhi(:,:), hflux(:,:), wflux(:,:) 53 53 REAL(rstd),POINTER :: u(:,:), w(:,:), qu(:,:), qv(:,:) … … 107 107 mass=f_mass(ind) 108 108 theta = f_theta(ind) 109 CALL compute_theta(ps,theta_rhodz , mass,theta)109 CALL compute_theta(ps,theta_rhodz(:,:,1), mass,theta) 110 110 pk = f_pk(ind) 111 111 geopot = f_geopot(ind) … … 163 163 CALL compute_caldyn_slow_NH(u,mass,geopot,W, hflux,du,dPhi,dW) 164 164 END IF 165 CALL compute_caldyn_Coriolis(hflux,theta,qu, convm,dtheta_rhodz ,du)165 CALL compute_caldyn_Coriolis(hflux,theta,qu, convm,dtheta_rhodz(:,:,1),du) 166 166 IF(caldyn_eta==eta_mass) THEN 167 167 wflux=f_wflux(ind) -
codes/icosagcm/trunk/src/check_conserve.f90
r365 r387 256 256 REAL(rstd), POINTER :: ue(:,:) 257 257 REAL(rstd), POINTER :: p(:,:) 258 REAL(rstd), POINTER :: theta_rhodz(:,: )258 REAL(rstd), POINTER :: theta_rhodz(:,:,:) 259 259 REAL(rstd), POINTER :: pk(:,:) 260 260 REAL(rstd), POINTER :: phis(:) … … 275 275 pk=f_pk(ind) 276 276 phis=f_phis(ind) 277 CALL compute_energy(ind,ue,p,rhodz,theta_rhodz ,pk,phis, &277 CALL compute_energy(ind,ue,p,rhodz,theta_rhodz(:,:,1),pk,phis, & 278 278 e, s, AAM_mass, AAM_vel, rmsv) 279 279 END DO -
codes/icosagcm/trunk/src/dissip_gcm.f90
r360 r387 241 241 IF (is_master) PRINT *, 'mean T-cell edge size (km)', 1.45*radius/iim_glo/1000., & 242 242 'effective T-cell half-edge size (km)', dumax**(-.5/nitergdiv)/1000 243 IF (is_master) PRINT *, 'Max. time step assuming c=340 m/s and Courant number= 4:', &244 4./340.*dumax**(-.5/nitergdiv)243 IF (is_master) PRINT *, 'Max. time step assuming c=340 m/s and Courant number=3 (ARK2.3) :', & 244 3./340.*dumax**(-.5/nitergdiv) 245 245 246 246 cgraddiv=dumax**(-1./nitergdiv) … … 469 469 REAL(rstd),POINTER :: due_diss1(:,:) 470 470 REAL(rstd),POINTER :: due_diss2(:,:) 471 REAL(rstd),POINTER :: dtheta_rhodz(:,: )471 REAL(rstd),POINTER :: dtheta_rhodz(:,:,:) 472 472 REAL(rstd),POINTER :: dtheta_rhodz_diss(:,:) 473 473 … … 508 508 due(ij+u_ldown,l) = -0.5*( due_diss1(ij+u_ldown,l)/tau_graddiv(l) + due_diss2(ij+u_ldown,l)/tau_gradrot(l))*itau_dissip 509 509 510 dtheta_rhodz(ij,l ) = -0.5*dtheta_rhodz_diss(ij,l)/tau_divgrad(l)*itau_dissip510 dtheta_rhodz(ij,l,1) = -0.5*dtheta_rhodz_diss(ij,l)/tau_divgrad(l)*itau_dissip 511 511 ENDDO 512 512 ENDDO … … 715 715 716 716 REAL(rstd),POINTER :: mass(:,:) 717 REAL(rstd),POINTER :: theta_rhodz(:,: )717 REAL(rstd),POINTER :: theta_rhodz(:,:,:) 718 718 REAL(rstd),POINTER :: dtheta_rhodz(:,:) 719 719 … … 733 733 !$SIMD 734 734 DO ij=ij_begin,ij_end 735 dtheta_rhodz(ij,l) = theta_rhodz(ij,l ) / mass(ij,l)735 dtheta_rhodz(ij,l) = theta_rhodz(ij,l,1) / mass(ij,l) 736 736 ENDDO 737 737 ENDDO -
codes/icosagcm/trunk/src/etat0.f90
r382 r387 137 137 REAL(rstd),POINTER :: mass(:,:) 138 138 REAL(rstd),POINTER :: phis(:) 139 REAL(rstd),POINTER :: theta_rhodz(:,: )139 REAL(rstd),POINTER :: theta_rhodz(:,:,:) 140 140 REAL(rstd),POINTER :: temp(:,:) 141 141 REAL(rstd),POINTER :: u(:,:) … … 162 162 163 163 IF( TRIM(etat0_type)=='williamson91.6' ) THEN 164 CALL compute_etat0_collocated(ps,mass, phis, theta_rhodz, u, geopot, W, q)164 CALL compute_etat0_collocated(ps,mass, phis, theta_rhodz(:,:,1), u, geopot, W, q) 165 165 ELSE 166 CALL compute_etat0_collocated(ps,mass, phis, temp, u, geopot, W, q)166 CALL compute_etat0_collocated(ps,mass, phis, temp, u, geopot, W, q) 167 167 ENDIF 168 168 ENDDO -
codes/icosagcm/trunk/src/euler_scheme.f90
r366 r387 33 33 REAL(rstd),POINTER :: u(:,:) , du(:,:) 34 34 REAL(rstd),POINTER :: mass(:,:), dmass(:,:) 35 REAL(rstd),POINTER :: theta_rhodz(:,: ), dtheta_rhodz(:,:)35 REAL(rstd),POINTER :: theta_rhodz(:,:,:), dtheta_rhodz(:,:,:) 36 36 REAL(rstd),POINTER :: hflux(:,:),wflux(:,:),hfluxt(:,:),wfluxt(:,:) 37 37 INTEGER :: ind … … 77 77 u(ij+u_lup,l)=u(ij+u_lup,l)+dt*du(ij+u_lup,l) 78 78 u(ij+u_ldown,l)=u(ij+u_ldown,l)+dt*du(ij+u_ldown,l) 79 theta_rhodz(ij,l )=theta_rhodz(ij,l)+dt*dtheta_rhodz(ij,l)79 theta_rhodz(ij,l,1)=theta_rhodz(ij,l,1)+dt*dtheta_rhodz(ij,l,1) 80 80 ENDDO 81 81 ENDDO -
codes/icosagcm/trunk/src/grid_param.f90
r280 r387 4 4 INTEGER,PARAMETER :: nb_face=10 5 5 INTEGER :: llm=19 6 INTEGER :: nqtot 6 INTEGER :: nqtot ! number of tracers handled by advection scheme 7 INTEGER :: nqdyn ! number of dynamical tracers : 1 if dry, more if moist 7 8 8 9 CONTAINS -
codes/icosagcm/trunk/src/hevi_scheme.f90
r371 r387 80 80 CALL update_2D(bjl(l,j), f_ps, f_dps_slow(:,l)) 81 81 ELSE 82 CALL update (bjl(l,j), f_mass, f_dmass_slow(:,l))82 CALL update_3D(bjl(l,j), f_mass, f_dmass_slow(:,l)) 83 83 END IF 84 CALL update (bjl(l,j), f_theta_rhodz, f_dtheta_rhodz_slow(:,l))85 CALL update (bjl(l,j), f_u, f_du_slow(:,l))86 CALL update (cjl(l,j), f_u, f_du_fast(:,l))84 CALL update_4D(bjl(l,j), f_theta_rhodz, f_dtheta_rhodz_slow(:,l)) 85 CALL update_3D(bjl(l,j), f_u, f_du_slow(:,l)) 86 CALL update_3D(cjl(l,j), f_u, f_du_fast(:,l)) 87 87 IF(.NOT. hydrostatic) THEN 88 CALL update (bjl(l,j), f_W, f_dW_slow(:,l))89 CALL update (cjl(l,j), f_W, f_dW_fast(:,l))90 CALL update (bjl(l,j), f_geopot, f_dPhi_slow(:,l))91 CALL update (cjl(l,j), f_geopot, f_dPhi_fast(:,l))88 CALL update_3D(bjl(l,j), f_W, f_dW_slow(:,l)) 89 CALL update_3D(cjl(l,j), f_W, f_dW_fast(:,l)) 90 CALL update_3D(bjl(l,j), f_geopot, f_dPhi_slow(:,l)) 91 CALL update_3D(cjl(l,j), f_geopot, f_dPhi_fast(:,l)) 92 92 END IF 93 93 END DO … … 96 96 END SUBROUTINE HEVI_scheme 97 97 98 SUBROUTINE update(w, f_y, f_dy) 98 SUBROUTINE update_4D(w, f_y, f_dy) 99 USE dimensions 100 USE grid_param, ONLY : nqdyn 101 REAL(rstd) :: w 102 TYPE(t_field) :: f_y(:), f_dy(:) 103 REAL(rstd), POINTER :: y(:,:,:), dy(:,:,:) 104 INTEGER :: ind, iq 105 IF(w /= 0.) THEN 106 DO ind=1,ndomain 107 IF (.NOT. assigned_domain(ind)) CYCLE 108 CALL swap_dimensions(ind) 109 dy=f_dy(ind); y=f_y(ind) 110 DO iq=1,nqdyn 111 CALL compute_update_3D(w,y(:,:,iq),dy(:,:,iq)) 112 END DO 113 ENDDO 114 END IF 115 END SUBROUTINE update_4D 116 117 SUBROUTINE update_3D(w, f_y, f_dy) 99 118 USE dimensions 100 119 REAL(rstd) :: w … … 107 126 CALL swap_dimensions(ind) 108 127 dy=f_dy(ind); y=f_y(ind) 109 CALL compute_update (w,y,dy)128 CALL compute_update_3D(w,y,dy) 110 129 ENDDO 111 130 END IF 112 END SUBROUTINE update 131 END SUBROUTINE update_3D 113 132 114 SUBROUTINE compute_update (w, y, dy)133 SUBROUTINE compute_update_3D(w, y, dy) 115 134 USE omp_para 116 135 USE disvert_mod … … 123 142 y(:,l)=y(:,l)+w*dy(:,l) 124 143 ENDDO 125 END SUBROUTINE compute_update 144 END SUBROUTINE compute_update_3D 126 145 127 146 SUBROUTINE update_2D(w, f_y, f_dy) -
codes/icosagcm/trunk/src/observable.f90
r377 r387 214 214 TYPE(t_field), POINTER :: f_ps(:), f_phis(:), f_theta_rhodz(:), & ! IN 215 215 f_pks(:), f_p(:), f_theta(:), f_pk(:), f_phi(:) ! OUT 216 REAL(rstd),POINTER :: pk(:,:), p(:,:), theta(:,:), theta_rhodz(:,: ), &216 REAL(rstd),POINTER :: pk(:,:), p(:,:), theta(:,:), theta_rhodz(:,:,:), & 217 217 phi(:,:), phis(:), ps(:), pks(:) 218 218 INTEGER :: ind … … 233 233 theta_rhodz = f_theta_rhodz(ind) 234 234 theta = f_theta(ind) 235 CALL compute_theta_rhodz2theta(ps, theta_rhodz ,theta,0)235 CALL compute_theta_rhodz2theta(ps, theta_rhodz(:,:,1),theta,0) 236 236 phis = f_phis(ind) 237 237 phi = f_phi(ind) -
codes/icosagcm/trunk/src/physics.f90
r381 r387 94 94 TYPE(t_field),POINTER :: f_wflux(:) 95 95 TYPE(t_field),POINTER :: f_q(:) 96 REAL(rstd),POINTER :: phis(:)97 REAL(rstd),POINTER :: ps(:)98 REAL(rstd),POINTER :: theta_rhodz(:,:)99 REAL(rstd),POINTER :: ue(:,:)100 REAL(rstd),POINTER :: q(:,:,:)101 96 102 97 LOGICAL:: firstcall,lastcall … … 153 148 REAL(rstd),POINTER :: ps(:) 154 149 REAL(rstd),POINTER :: temp(:,:) 155 REAL(rstd),POINTER :: theta_rhodz(:,:)156 150 REAL(rstd),POINTER :: ue(:,:) 157 151 REAL(rstd),POINTER :: dulon(:,:) -
codes/icosagcm/trunk/src/theta_rhodz.f90
r323 r387 58 58 59 59 REAL(rstd), POINTER :: ps(:) 60 REAL(rstd), POINTER :: theta_rhodz(:,: )60 REAL(rstd), POINTER :: theta_rhodz(:,:,:) 61 61 REAL(rstd), POINTER :: temp(:,:) 62 62 REAL(rstd), POINTER :: p(:,:) … … 81 81 CALL compute_exner(ps,p,pks,pk,0) 82 82 !$OMP BARRIER 83 CALL compute_theta_rhodz2temperature(p, pk, theta_rhodz ,temp,0)83 CALL compute_theta_rhodz2temperature(p, pk, theta_rhodz(:,:,1),temp,0) 84 84 ENDDO 85 85 !$OMP BARRIER … … 97 97 98 98 REAL(rstd), POINTER :: ps(:) 99 REAL(rstd), POINTER :: theta_rhodz(:,: )99 REAL(rstd), POINTER :: theta_rhodz(:,:,:) 100 100 REAL(rstd), POINTER :: temp(:,:) 101 101 REAL(rstd), POINTER :: p(:,:) … … 120 120 CALL compute_exner(ps,p,pks,pk,0) 121 121 !$OMP BARRIER 122 CALL compute_temperature2theta_rhodz(p, pk, temp, theta_rhodz , 0)122 CALL compute_temperature2theta_rhodz(p, pk, temp, theta_rhodz(:,:,1), 0) 123 123 ENDDO 124 124 !$OMP BARRIER -
codes/icosagcm/trunk/src/timeloop_gcm.f90
r377 r387 41 41 STOP 42 42 END IF 43 44 nqdyn = 1 ! one dynamical tracer = theta for the moment 43 45 44 46 def='ARK2.3' … … 87 89 CALL allocate_field(f_mass,field_t,type_real,llm,name='mass') 88 90 CALL allocate_field(f_rhodz,field_t,type_real,llm,name='rhodz') 89 CALL allocate_field(f_theta_rhodz,field_t,type_real,llm,n ame='theta_rhodz')91 CALL allocate_field(f_theta_rhodz,field_t,type_real,llm,nqdyn,name='theta_rhodz') 90 92 CALL allocate_field(f_u,field_u,type_real,llm,name='u') 91 93 CALL allocate_field(f_geopot,field_t,type_real,llm+1,name='geopot') … … 103 105 CALL allocate_field(f_dps,field_t,type_real,name='dps') 104 106 CALL allocate_field(f_dmass,field_t,type_real,llm, name='dmass') 105 CALL allocate_field(f_dtheta_rhodz,field_t,type_real,llm,n ame='dtheta_rhodz')107 CALL allocate_field(f_dtheta_rhodz,field_t,type_real,llm,nqdyn,name='dtheta_rhodz') 106 108 CALL allocate_field(f_du,field_u,type_real,llm,name='du') 107 109 ! Model state at previous time step (RK/MLF) 108 110 CALL allocate_field(f_psm1,field_t,type_real,name='psm1') 109 111 CALL allocate_field(f_massm1,field_t,type_real,llm, name='massm1') 110 CALL allocate_field(f_theta_rhodzm1,field_t,type_real,llm,n ame='theta_rhodzm1')112 CALL allocate_field(f_theta_rhodzm1,field_t,type_real,llm,nqdyn,name='theta_rhodzm1') 111 113 CALL allocate_field(f_um1,field_u,type_real,llm,name='um1') 112 114 CASE(hevi) … … 114 116 CALL allocate_fields(nb_stage,f_dps_slow, field_t,type_real,name='dps_slow') 115 117 CALL allocate_fields(nb_stage,f_dmass_slow, field_t,type_real,llm, name='dmass_slow') 116 CALL allocate_fields(nb_stage,f_dtheta_rhodz_slow, field_t,type_real,llm,n ame='dtheta_rhodz_fast')118 CALL allocate_fields(nb_stage,f_dtheta_rhodz_slow, field_t,type_real,llm,nqdyn,name='dtheta_rhodz_fast') 117 119 CALL allocate_fields(nb_stage,f_du_slow, field_u,type_real,llm,name='du_slow') 118 120 CALL allocate_fields(nb_stage,f_du_fast, field_u,type_real,llm,name='du_fast') … … 131 133 CALL allocate_field(f_psm2,field_t,type_real) 132 134 CALL allocate_field(f_massm2,field_t,type_real,llm) 133 CALL allocate_field(f_theta_rhodzm2,field_t,type_real,llm )135 CALL allocate_field(f_theta_rhodzm2,field_t,type_real,llm,nqdyn) 134 136 CALL allocate_field(f_um2,field_u,type_real,llm) 135 137 END SELECT … … 208 210 fluxt_zero=.TRUE. 209 211 210 IF(positive_theta) CALL copy_theta_to_q 1(f_theta_rhodz,f_rhodz,f_q)212 IF(positive_theta) CALL copy_theta_to_q(f_theta_rhodz,f_rhodz,f_q) 211 213 212 214 !$OMP MASTER … … 303 305 END DO 304 306 ENDIF 305 IF(positive_theta) CALL copy_q 1_to_theta(f_theta_rhodz,f_rhodz,f_q)307 IF(positive_theta) CALL copy_q_to_theta(f_theta_rhodz,f_rhodz,f_q) 306 308 END IF 307 309 … … 360 362 END SUBROUTINE print_iteration 361 363 362 SUBROUTINE copy_theta_to_q 1(f_theta_rhodz,f_rhodz,f_q)364 SUBROUTINE copy_theta_to_q(f_theta_rhodz,f_rhodz,f_q) 363 365 TYPE(t_field),POINTER :: f_theta_rhodz(:),f_rhodz(:), f_q(:) 364 REAL(rstd), POINTER :: theta_rhodz(:,: ), rhodz(:,:), q(:,:,:)365 INTEGER :: ind 366 REAL(rstd), POINTER :: theta_rhodz(:,:,:), rhodz(:,:), q(:,:,:) 367 INTEGER :: ind, iq 366 368 DO ind=1, ndomain 367 369 IF (.NOT. assigned_domain(ind)) CYCLE … … 371 373 rhodz=f_rhodz(ind) 372 374 q=f_q(ind) 373 q(:,:,1) = theta_rhodz(:,:)/rhodz(:,:) 375 DO iq=1, nqdyn 376 q(:,:,iq) = theta_rhodz(:,:,iq)/rhodz(:,:) 377 END DO 374 378 END DO 375 END SUBROUTINE copy_theta_to_q 1376 377 SUBROUTINE copy_q 1_to_theta(f_theta_rhodz,f_rhodz,f_q)379 END SUBROUTINE copy_theta_to_q 380 381 SUBROUTINE copy_q_to_theta(f_theta_rhodz,f_rhodz,f_q) 378 382 TYPE(t_field),POINTER :: f_theta_rhodz(:),f_rhodz(:), f_q(:) 379 REAL(rstd), POINTER :: theta_rhodz(:,: ), rhodz(:,:), q(:,:,:)380 INTEGER :: ind 383 REAL(rstd), POINTER :: theta_rhodz(:,:,:), rhodz(:,:), q(:,:,:) 384 INTEGER :: ind, iq 381 385 DO ind=1, ndomain 382 386 IF (.NOT. assigned_domain(ind)) CYCLE … … 386 390 rhodz=f_rhodz(ind) 387 391 q=f_q(ind) 388 theta_rhodz(:,:) = rhodz(:,:)*q(:,:,1) 392 DO iq=1,nqdyn 393 theta_rhodz(:,:,iq) = rhodz(:,:)*q(:,:,iq) 394 END DO 389 395 END DO 390 END SUBROUTINE copy_q 1_to_theta396 END SUBROUTINE copy_q_to_theta 391 397 392 398 END MODULE timeloop_gcm_mod
Note: See TracChangeset
for help on using the changeset viewer.