Changeset 350
- Timestamp:
- 08/02/15 00:53:35 (9 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/caldyn.f90
r251 r350 31 31 END SUBROUTINE init_caldyn 32 32 33 SUBROUTINE caldyn_BC(f_phis, f_ wflux)33 SUBROUTINE caldyn_BC(f_phis, f_geopot, f_wflux) 34 34 USE caldyn_gcm_mod, ONLY : caldyn_gcm_BC=>caldyn_BC 35 35 IMPLICIT NONE 36 TYPE(t_field), POINTER :: f_phis(:), f_ wflux(:)36 TYPE(t_field), POINTER :: f_phis(:), f_geopot(:), f_wflux(:) 37 37 SELECT CASE (TRIM(caldyn_type)) 38 38 CASE('gcm') 39 CALL caldyn_gcm_BC(f_phis, f_ wflux)39 CALL caldyn_gcm_BC(f_phis, f_geopot, f_wflux) 40 40 END SELECT 41 41 END SUBROUTINE caldyn_BC 42 42 43 43 SUBROUTINE caldyn(write_out,f_phis, f_ps, f_mass, f_theta_rhodz, f_u, f_q, & 44 f_ hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du)44 f_geopot, f_hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du) 45 45 USE icosa 46 46 USE caldyn_gcm_mod, ONLY : caldyn_gcm=>caldyn … … 54 54 TYPE(t_field),POINTER :: f_u(:) 55 55 TYPE(t_field),POINTER :: f_q(:) 56 TYPE(t_field),POINTER :: f_geopot(:) 56 57 TYPE(t_field),POINTER :: f_hflux(:) 57 58 TYPE(t_field),POINTER :: f_wflux(:) … … 64 65 CASE('gcm') 65 66 CALL caldyn_gcm(write_out,f_phis, f_ps, f_mass, f_theta_rhodz, f_u, f_q, & 66 f_ hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du)67 f_geopot, f_hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du) 67 68 CASE('adv') 68 69 CALL caldyn_adv(write_out,f_phis, f_ps, f_theta_rhodz, f_u, f_q, & -
codes/icosagcm/trunk/src/caldyn_gcm.f90
r349 r350 2 2 USE icosa 3 3 USE transfert_mod 4 IMPLICIT NONE 4 5 PRIVATE 5 6 … … 15 16 TYPE(t_field),POINTER :: f_theta(:) 16 17 TYPE(t_field),POINTER :: f_pk(:) 17 TYPE(t_field),POINTER :: f_geopot(:)18 18 TYPE(t_field),POINTER :: f_wwuu(:) 19 19 TYPE(t_field),POINTER :: f_planetvel(:) … … 83 83 CALL allocate_field(f_theta, field_t,type_real,llm, name='theta') ! potential temperature 84 84 CALL allocate_field(f_pk, field_t,type_real,llm, name='pk') 85 CALL allocate_field(f_geopot,field_t,type_real,llm+1,name='geopot') ! geopotential86 85 CALL allocate_field(f_wwuu, field_u,type_real,llm+1,name='wwuu') 87 86 CALL allocate_field(f_planetvel, field_u,type_real, name='planetvel') ! planetary velocity at r=a … … 89 88 END SUBROUTINE allocate_caldyn 90 89 91 SUBROUTINE caldyn_BC(f_phis, f_ wflux)90 SUBROUTINE caldyn_BC(f_phis, f_geopot, f_wflux) 92 91 USE icosa 93 92 USE mpipara 94 93 USE omp_para 95 IMPLICIT NONE96 94 TYPE(t_field),POINTER :: f_phis(:) 95 TYPE(t_field),POINTER :: f_geopot(:) 97 96 TYPE(t_field),POINTER :: f_wflux(:) 98 97 REAL(rstd),POINTER :: phis(:) … … 133 132 134 133 SUBROUTINE caldyn(write_out,f_phis, f_ps, f_mass, f_theta_rhodz, f_u, f_q, & 135 f_ hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du)134 f_geopot, f_hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du) 136 135 USE icosa 137 136 USE disvert_mod, ONLY : caldyn_eta, eta_mass … … 153 152 TYPE(t_field),POINTER :: f_u(:) 154 153 TYPE(t_field),POINTER :: f_q(:) 154 TYPE(t_field),POINTER :: f_geopot(:) 155 155 TYPE(t_field),POINTER :: f_hflux(:), f_wflux(:) 156 156 TYPE(t_field),POINTER :: f_dps(:) … … 329 329 INTEGER :: ij 330 330 DO ij=ij_begin_ext,ij_end_ext 331 ulon(ij+u_right)= a*omega*cos(lat_e(ij+u_right))331 ulon(ij+u_right)=radius*omega*cos(lat_e(ij+u_right)) 332 332 ulat(ij+u_right)=0 333 333 334 ulon(ij+u_lup)= a*omega*cos(lat_e(ij+u_lup))334 ulon(ij+u_lup)=radius*omega*cos(lat_e(ij+u_lup)) 335 335 ulat(ij+u_lup)=0 336 336 337 ulon(ij+u_ldown)= a*omega*cos(lat_e(ij+u_ldown))337 ulon(ij+u_ldown)=radius*omega*cos(lat_e(ij+u_ldown)) 338 338 ulat(ij+u_ldown)=0 339 339 END DO … … 959 959 f_buf_i(:), f_buf_v(:), f_buf_i3(:), f_buf1_i(:), f_buf2_i(:), f_buf_s(:), f_buf_p(:) 960 960 961 REAL(rstd) :: out_pression_lev 961 REAL(rstd) :: out_pression_level 962 962 CHARACTER(LEN=255) :: str_pression 963 963 CHARACTER(LEN=255) :: physics_type 964 964 965 out_pression_level=0 965 out_pression_level=0. 966 966 CALL getin("out_pression_level",out_pression_level) 967 967 WRITE(str_pression,*) INT(out_pression_level/100) … … 1015 1015 CALL thetarhodz2geopot(f_ps,f_phis,f_theta_rhodz, f_buf_s,f_buf_p,f_buf1_i,f_buf2_i,f_buf_i) 1016 1016 CALL writefield("p",f_buf_p) 1017 CALL writefield("phi",f_geopot) ! geopotential1017 ! CALL writefield("phi",f_geopot) ! geopotential 1018 1018 CALL writefield("theta",f_buf1_i) ! potential temperature 1019 1019 CALL writefield("pk",f_buf2_i) ! Exner pressure -
codes/icosagcm/trunk/src/field.f90
r295 r350 1 1 MODULE field_mod 2 2 USE genmod 3 IMPLICIT NONE 3 4 4 5 INTEGER,PARAMETER :: field_T=1 … … 43 44 END INTERFACE 44 45 46 PRIVATE :: allocate_field_ 45 47 46 48 CONTAINS … … 49 51 USE domain_mod 50 52 USE omp_para 51 IMPLICIT NONE52 53 TYPE(t_field),POINTER :: field(:) 54 INTEGER,INTENT(IN) :: field_type 55 INTEGER,INTENT(IN) :: data_type 56 INTEGER,OPTIONAL :: dim1,dim2 57 CHARACTER(*), OPTIONAL :: name 58 !$OMP BARRIER 59 !$OMP MASTER 60 ALLOCATE(field(ndomain)) 61 !$OMP END MASTER 62 !$OMP BARRIER 63 CALL allocate_field_(field,field_type,data_type,dim1,dim2,name) 64 END SUBROUTINE allocate_field 65 66 SUBROUTINE allocate_fields(nfield,field,field_type,data_type,dim1,dim2,name) 67 USE domain_mod 68 USE omp_para 69 INTEGER,INTENT(IN) :: nfield 70 TYPE(t_field),POINTER :: field(:,:) 71 INTEGER,INTENT(IN) :: field_type 72 INTEGER,INTENT(IN) :: data_type 73 INTEGER,OPTIONAL :: dim1,dim2 74 CHARACTER(*), OPTIONAL :: name 75 INTEGER :: i 76 !$OMP BARRIER 77 !$OMP MASTER 78 ALLOCATE(field(ndomain,nfield)) 79 !$OMP END MASTER 80 !$OMP BARRIER 81 DO i=1,nfield 82 CALL allocate_field_(field(:,i),field_type,data_type,dim1,dim2,name) 83 END DO 84 END SUBROUTINE allocate_fields 85 86 SUBROUTINE allocate_field_(field,field_type,data_type,dim1,dim2,name) 87 USE domain_mod 88 USE omp_para 89 IMPLICIT NONE 90 TYPE(t_field) :: field(:) 53 91 INTEGER,INTENT(IN) :: field_type 54 92 INTEGER,INTENT(IN) :: data_type … … 57 95 INTEGER :: ind 58 96 INTEGER :: ii_size,jj_size 59 60 !$OMP BARRIER61 !$OMP MASTER62 ALLOCATE(field(ndomain))63 !$OMP END MASTER64 !$OMP BARRIER65 97 66 98 DO ind=1,ndomain … … 115 147 !$OMP BARRIER 116 148 117 END SUBROUTINE allocate_field149 END SUBROUTINE allocate_field_ 118 150 119 151 SUBROUTINE allocate_field_glo(field,field_type,data_type,dim1,dim2,name) … … 181 213 182 214 SUBROUTINE deallocate_field(field) 215 USE domain_mod 216 USE omp_para 217 IMPLICIT NONE 218 TYPE(t_field),POINTER :: field(:) 219 !$OMP BARRIER 220 CALL deallocate_field_(field) 221 !$OMP BARRIER 222 !$OMP MASTER 223 DEALLOCATE(field) 224 !$OMP END MASTER 225 !$OMP BARRIER 226 END SUBROUTINE deallocate_field 227 228 SUBROUTINE deallocate_fields(field) 229 USE domain_mod 230 USE omp_para 231 IMPLICIT NONE 232 TYPE(t_field),POINTER :: field(:,:) 233 INTEGER :: i 234 !$OMP BARRIER 235 DO i=1,SIZE(field,2) 236 CALL deallocate_field_(field(:,i)) 237 END DO 238 !$OMP BARRIER 239 !$OMP MASTER 240 DEALLOCATE(field) 241 !$OMP END MASTER 242 !$OMP BARRIER 243 END SUBROUTINE deallocate_fields 244 245 SUBROUTINE deallocate_field_(field) 183 246 USE domain_mod 184 247 USE omp_para 185 248 IMPLICIT NONE 186 TYPE(t_field) ,POINTER:: field(:)249 TYPE(t_field) :: field(:) 187 250 INTEGER :: data_type 188 251 INTEGER :: ind 189 190 !$OMP BARRIER191 252 DO ind=1,ndomain 192 253 IF (.NOT. assigned_domain(ind) .OR. .NOT. is_omp_level_master) CYCLE … … 209 270 210 271 ENDDO 211 !$OMP BARRIER 212 !$OMP MASTER 213 DEALLOCATE(field) 214 !$OMP END MASTER 215 !$OMP BARRIER 216 217 END SUBROUTINE deallocate_field 272 END SUBROUTINE deallocate_field_ 218 273 219 274 SUBROUTINE deallocate_field_glo(field) -
codes/icosagcm/trunk/src/timeloop_gcm.f90
r347 r350 2 2 USE transfert_mod 3 3 USE icosa 4 IMPLICIT NONE 4 5 PRIVATE 5 6 … … 13 14 TYPE(t_message),SAVE :: req_ps0, req_mass0, req_theta_rhodz0, req_u0, req_q0 14 15 16 TYPE(t_field),POINTER,SAVE :: f_geopot(:) 15 17 TYPE(t_field),POINTER,SAVE :: f_q(:) 16 18 TYPE(t_field),POINTER,SAVE :: f_rhodz(:), f_mass(:), f_massm1(:), f_massm2(:), f_dmass(:) … … 43 45 USE theta2theta_rhodz_mod 44 46 USE sponge_mod 45 IMPLICIT NONE 46 47 CHARACTER(len=255) :: def 47 48 CHARACTER(len=255) :: def 48 49 49 50 … … 58 59 ! Model state at current time step (RK/MLF/Euler) 59 60 CALL allocate_field(f_ps,field_t,type_real, name='ps') 61 CALL allocate_field(f_geopot,field_t,type_real,llm+1,name='geopot') 60 62 CALL allocate_field(f_mass,field_t,type_real,llm,name='mass') 61 63 CALL allocate_field(f_u,field_u,type_real,llm,name='u') … … 189 191 190 192 CALL switch_omp_distrib_level 191 CALL caldyn_BC(f_phis, f_ wflux) ! set constant values in first/last interfaces193 CALL caldyn_BC(f_phis, f_geopot, f_wflux) ! set constant values in first/last interfaces 192 194 193 195 !$OMP BARRIER … … 251 253 CALL caldyn((stage==1) .AND. (MOD(it,itau_out)==0), & 252 254 f_phis,f_ps,f_mass,f_theta_rhodz,f_u, f_q, & 253 f_ hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du)255 f_geopot, f_hflux, f_wflux, f_dps, f_dmass, f_dtheta_rhodz, f_du) 254 256 ! CALL checksum(f_dps) 255 257 ! CALL checksum(f_dtheta_rhodz)
Note: See TracChangeset
for help on using the changeset viewer.