Changeset 362 for codes/icosagcm/trunk/src/euler_scheme.f90
- Timestamp:
- 09/25/15 14:36:36 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/euler_scheme.f90
r360 r362 19 19 !$OMP THREADPRIVATE(nb_stage, matsuno_period, scheme, scheme_family) 20 20 21 22 PUBLIC :: euler_scheme, accumulate_fluxes 21 PUBLIC :: euler_scheme, accumulate_fluxes, legacy_to_DEC, DEC_to_legacy 23 22 CONTAINS 24 23 … … 143 142 END SUBROUTINE accumulate_fluxes 144 143 144 SUBROUTINE legacy_to_DEC(f_ps, f_u) 145 USE icosa 146 USE disvert_mod 147 USE omp_para 148 USE trace 149 TYPE(t_field),POINTER :: f_ps(:), f_u(:) 150 REAL(rstd), POINTER :: ps(:), u(:,:) 151 INTEGER :: ind,ij,l 152 CALL trace_start("legacy_to_DEC") 153 154 DO ind=1,ndomain 155 IF (.NOT. assigned_domain(ind)) CYCLE 156 CALL swap_dimensions(ind) 157 CALL swap_geometry(ind) 158 159 IF(caldyn_eta==eta_mass .AND. is_omp_first_level) THEN ! update ps 160 ps=f_ps(ind) 161 !$SIMD 162 DO ij=ij_begin,ij_end 163 ps(ij)=(ps(ij)-ptop)/g ! convert ps to column-integrated mass 164 ENDDO 165 END IF 166 167 u=f_u(ind) 168 DO l=ll_begin,ll_end 169 !$SIMD 170 DO ij=ij_begin,ij_end 171 u(ij+u_right,l)=u(ij+u_right,l)*de(ij+u_right) 172 u(ij+u_lup,l)=u(ij+u_lup,l)*de(ij+u_lup) 173 u(ij+u_ldown,l)=u(ij+u_ldown,l)*de(ij+u_ldown) 174 ENDDO 175 ENDDO 176 ENDDO 177 178 CALL trace_end("legacy_to_DEC") 179 END SUBROUTINE Legacy_to_DEC 180 181 SUBROUTINE DEC_to_legacy(f_ps, f_u) 182 USE icosa 183 USE disvert_mod 184 USE omp_para 185 USE trace 186 TYPE(t_field),POINTER :: f_ps(:), f_u(:) 187 REAL(rstd), POINTER :: ps(:), u(:,:) 188 INTEGER :: ind,ij,l 189 CALL trace_start("legacy_to_DEC") 190 191 DO ind=1,ndomain 192 IF (.NOT. assigned_domain(ind)) CYCLE 193 CALL swap_dimensions(ind) 194 CALL swap_geometry(ind) 195 196 IF(caldyn_eta==eta_mass .AND. is_omp_first_level) THEN 197 ps=f_ps(ind) 198 !$SIMD 199 DO ij=ij_begin,ij_end 200 ps(ij)=ptop+ps(ij)*g ! convert column-integrated mass to ps 201 ENDDO 202 ENDIF 203 204 u=f_u(ind) 205 DO l=ll_begin,ll_end 206 !$SIMD 207 DO ij=ij_begin,ij_end 208 u(ij+u_right,l)=u(ij+u_right,l)/de(ij+u_right) 209 u(ij+u_lup,l)=u(ij+u_lup,l)/de(ij+u_lup) 210 u(ij+u_ldown,l)=u(ij+u_ldown,l)/de(ij+u_ldown) 211 ENDDO 212 ENDDO 213 ENDDO 214 215 CALL trace_end("DEC_to_legacy") 216 END SUBROUTINE DEC_to_legacy 217 145 218 END MODULE euler_scheme_mod
Note: See TracChangeset
for help on using the changeset viewer.