Changeset 668
- Timestamp:
- 01/27/18 00:10:07 (6 years ago)
- Location:
- codes/icosagcm/trunk/src
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/diagnostics/observable.f90
r605 r668 15 15 TYPE(t_field),POINTER, SAVE :: f_theta(:) 16 16 17 PUBLIC init_observable, write_output_fields_basic, f_theta, f_buf_i 17 PUBLIC init_observable, write_output_fields_basic, & 18 f_theta, f_buf_i, f_buf_ulon, f_buf_ulat 18 19 19 20 CONTAINS -
codes/icosagcm/trunk/src/diagnostics/wind.F90
r599 r668 12 12 CONTAINS 13 13 14 SUBROUTINE un2ulonlat(f_u, f_ulon, f_ulat )14 SUBROUTINE un2ulonlat(f_u, f_ulon, f_ulat, scale_) 15 15 TYPE(t_field), POINTER :: f_u(:) ! IN : normal velocity components on edges 16 16 TYPE(t_field), POINTER :: f_ulon(:), f_ulat(:) ! OUT : velocity reconstructed at hexagons 17 REAL(rstd),POINTER :: u(:,:), ulon(:,:), ulat(:,:) 17 REAL(rstd),POINTER :: u(:,:), ulon(:,:), ulat(:,:) 18 REAL(rstd), OPTIONAL :: scale_ 19 REAL(rstd) :: scale 18 20 INTEGER :: ind 19 21 scale = MERGE(scale_, 1., PRESENT(scale_)) 20 22 DO ind=1,ndomain 21 23 IF (.NOT. assigned_domain(ind)) CYCLE … … 25 27 ulon=f_ulon(ind) 26 28 ulat=f_ulat(ind) 27 CALL compute_un2ulonlat(u,ulon, ulat )29 CALL compute_un2ulonlat(u,ulon, ulat, scale) 28 30 END DO 29 31 … … 49 51 END SUBROUTINE ulonlat2un 50 52 51 SUBROUTINE compute_wind_centered(ue,ucenter )53 SUBROUTINE compute_wind_centered(ue,ucenter,scale_) 52 54 REAL(rstd) :: ue(3*iim*jjm,llm) 53 55 REAL(rstd) :: ucenter(iim*jjm,llm,3) 56 REAL(rstd), INTENT(IN), OPTIONAL :: scale_ 54 57 INTEGER :: ij,l 55 REAL(rstd) , PARAMETER :: scale=1.56 REAL(rstd) :: fac, ue_le, cx,cy,cz, ux,uy,uz58 REAL(rstd) :: scale,fac, ue_le, cx,cy,cz, ux,uy,uz 59 scale = MERGE(scale_, 1., PRESENT(scale_)) 57 60 #include "../kernels/wind_centered.k90" 58 61 END SUBROUTINE compute_wind_centered … … 328 331 329 332 330 SUBROUTINE compute_un2ulonlat(un, ulon, ulat )333 SUBROUTINE compute_un2ulonlat(un, ulon, ulat, scale) 331 334 REAL(rstd),INTENT(IN) :: un(3*iim*jjm,llm) 332 335 REAL(rstd),INTENT(OUT) :: ulon(iim*jjm,llm) 333 336 REAL(rstd),INTENT(OUT) :: ulat(iim*jjm,llm) 334 335 337 REAL(rstd) :: uc(iim*jjm,llm,3) 336 337 CALL compute_wind_centered(un,uc )338 REAL(rstd) :: scale 339 CALL compute_wind_centered(un,uc,scale) 338 340 CALL compute_wind_centered_lonlat_compound(uc, ulon, ulat) 339 341 -
codes/icosagcm/trunk/src/icosa_init.f90
r667 r668 58 58 59 59 CALL init_diagflux 60 CALL zero_du_phys 60 61 CALL timeloop 61 62 CALL switch_omp_no_distrib_level -
codes/icosagcm/trunk/src/physics/physics.f90
r599 r668 1 1 MODULE physics_mod 2 2 USE icosa 3 3 USE field_mod 4 4 USE physics_interface_mod 5 USE omp_para 6 IMPLICIT NONE 5 7 PRIVATE 6 8 … … 14 16 TYPE(t_field),POINTER,SAVE :: f_p(:), f_pk(:) 15 17 TYPE(t_field),POINTER,SAVE :: f_temp(:) 18 TYPE(t_field),POINTER,SAVE :: f_du_phys(:) 16 19 17 20 CHARACTER(LEN=255),SAVE :: physics_type 18 21 !$OMP THREADPRIVATE(physics_type) 19 22 20 PUBLIC :: physics, init_physics 23 PUBLIC :: physics, init_physics, zero_du_phys 21 24 22 25 CONTAINS … … 25 28 USE mpipara 26 29 USE etat0_mod 27 USE icosa28 USE physics_interface_mod29 30 USE physics_dcmip_mod, ONLY : init_physics_dcmip=>init_physics 30 31 USE physics_dcmip2016_mod, ONLY : init_physics_dcmip2016=>init_physics … … 32 33 USE physics_lmdz_generic_mod, ONLY : init_physics_lmdz_generic=>init_physics 33 34 USE physics_external_mod, ONLY : init_physics_external=>init_physics 34 IMPLICIT NONE35 35 36 36 physics_inout%dt_phys = dt*itau_physics … … 84 84 END SELECT 85 85 86 CALL allocate_field(f_du_phys,field_u,type_real,llm, name='du_phys') 87 86 88 IF(is_mpi_root) PRINT *, 'phys_type = ',phys_type 87 89 END SUBROUTINE init_physics 88 90 91 SUBROUTINE zero_du_phys() 92 REAL(rstd), DIMENSION(:,:), POINTER :: du 93 INTEGER :: ind 94 DO ind=1,ndomain 95 IF (.NOT. assigned_domain(ind)) CYCLE 96 CALL swap_dimensions(ind) 97 CALL swap_geometry(ind) 98 du=f_du_phys(ind) 99 du(:,ll_begin:ll_end) = 0. 100 END DO 101 END SUBROUTINE zero_du_phys 102 103 SUBROUTINE add_du_phys(coef, f_u) 104 REAL(rstd), INTENT(IN) :: coef ! -1 before physics, +1 after physics 105 TYPE(t_field),POINTER :: f_u(:) ! velocity field before/after call to physics 106 REAL(rstd), DIMENSION(:,:), POINTER :: u, du 107 INTEGER :: ind 108 DO ind=1,ndomain 109 IF (.NOT. assigned_domain(ind)) CYCLE 110 CALL swap_dimensions(ind) 111 CALL swap_geometry(ind) 112 du=f_du_phys(ind) 113 u=f_u(ind) 114 du(:,ll_begin:ll_end) = du(:,ll_begin:ll_end) + coef*u(:,ll_begin:ll_end) 115 END DO 116 END SUBROUTINE add_du_phys 117 89 118 SUBROUTINE physics(it,f_phis, f_ps, f_theta_rhodz, f_ue, f_wflux, f_q) 90 USE icosa91 USE physics_interface_mod92 119 USE physics_lmdz_generic_mod, ONLY : physics_lmdz_generic => physics 93 120 USE physics_external_mod, ONLY : physics_external => physics … … 96 123 USE etat0_heldsz_mod 97 124 USE etat0_venus_mod, ONLY : phys_venus => physics 98 IMPLICIT NONE99 125 INTEGER, INTENT(IN) :: it 100 126 TYPE(t_field),POINTER :: f_phis(:) … … 109 135 TYPE(t_physics_inout) :: args 110 136 111 IF(MOD(it,itau_physics)==0) THEN 112 137 IF(MOD(it,itau_physics)==0 .AND. phys_type/=phys_none) THEN 138 139 ! as a result of the the two calls to add_du_phys, 140 ! du_phys increases by u(after physics) - u (before physics) 141 CALL add_du_phys(-1., f_ue) 142 113 143 SELECT CASE(phys_type) 114 CASE (phys_none)115 ! No physics, do nothing116 144 CASE(phys_HS94) 117 145 CALL held_suarez(f_ps,f_theta_rhodz,f_ue) … … 129 157 CALL transfert_request(f_ue,req_e0_vect) 130 158 CALL transfert_request(f_q,req_i0) 159 160 CALL add_du_phys(1., f_ue) 131 161 END IF 132 162 133 163 IF (mod(it,itau_out)==0 ) THEN 164 CALL write_physics_tendencies 165 CALL zero_du_phys 134 166 SELECT CASE(phys_type) 135 167 CASE (phys_DCMIP) … … 142 174 END SUBROUTINE physics 143 175 176 SUBROUTINE write_physics_tendencies 177 USE observable_mod, ONLY : f_buf_ulon, f_buf_ulat 178 USE wind_mod 179 USE output_field_mod 180 CALL transfert_request(f_du_phys,req_e1_vect) 181 CALL un2ulonlat(f_du_phys, f_buf_ulon, f_buf_ulat, (1./(dt*itau_out))) 182 CALL output_field("dulon_phys",f_buf_ulon) 183 CALL output_field("dulat_phys",f_buf_ulat) 184 END SUBROUTINE write_physics_tendencies 185 144 186 SUBROUTINE physics_column(it, f_phis, f_ps, f_theta_rhodz, f_ue, f_q) 145 USE icosa146 USE physics_interface_mod147 187 USE physics_dcmip_mod, ONLY : full_physics_dcmip => full_physics 148 188 USE physics_dcmip2016_mod, ONLY : full_physics_dcmip2016 => full_physics 149 189 USE theta2theta_rhodz_mod 150 190 USE mpipara 151 USE omp_para152 191 USE checksum_mod 153 IMPLICIT NONE154 192 TYPE(t_field),POINTER :: f_phis(:) 155 193 TYPE(t_field),POINTER :: f_ps(:) … … 229 267 230 268 SUBROUTINE pack_physics(info, phis, ps, temp, ue, q, p, pk, ulon, ulat ) 231 USE icosa232 269 USE wind_mod 233 270 USE pression_mod 234 271 USE theta2theta_rhodz_mod 235 USE physics_interface_mod236 272 USE exner_mod 237 USE omp_para238 IMPLICIT NONE239 273 TYPE(t_pack_info) :: info 240 274 REAL(rstd) :: phis(iim*jjm) … … 272 306 273 307 SUBROUTINE unpack_physics(info, ps,temp, q, dulon, dulat) 274 USE icosa275 USE physics_interface_mod276 308 USE theta2theta_rhodz_mod 277 USE omp_para278 IMPLICIT NONE279 309 TYPE(t_pack_info) :: info 280 310 REAL(rstd) :: ps(iim*jjm) … … 303 333 304 334 SUBROUTINE compute_update_velocity(dulon, dulat, ue) 305 USE icosa306 USE physics_interface_mod307 335 USE wind_mod 308 USE omp_para309 IMPLICIT NONE310 336 REAL(rstd) :: dulon(iim*jjm,llm) 311 337 REAL(rstd) :: dulat(iim*jjm,llm)
Note: See TracChangeset
for help on using the changeset viewer.