Changeset 604 for codes/icosagcm/trunk/src/diagnostics
- Timestamp:
- 10/24/17 01:32:57 (7 years ago)
- Location:
- codes/icosagcm/trunk/src/diagnostics
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
codes/icosagcm/trunk/src/diagnostics/diagflux.F90
r599 r604 10 10 f_massfluxt(:), f_qfluxt(:), & ! time-integrated mass flux and tracer flux 11 11 f_qfluxt_lon(:), f_qfluxt_lat(:), & ! scalar flux reconstructed at cell centers 12 f_ epot(:), f_ekin(:), f_enthalpy(:), & ! time-averaged potential E, kinetic E and enthalpy13 f_ epotfluxt(:), f_ekinfluxt(:), f_enthalpyfluxt(:) ! time averaged 'fluxes' of epot, ekin and enthalpy12 f_ulont(:), f_thetat(:), f_epot(:), f_ekin(:), f_enthalpy(:), & ! time-averaged potential E, kinetic E and enthalpy 13 f_ulonfluxt(:), f_thetafluxt(:), f_epotfluxt(:), f_ekinfluxt(:), f_enthalpyfluxt(:) ! time averaged 'fluxes' of epot, ekin and enthalpy 14 14 LOGICAL :: diagflux_on 15 15 !$OMP THREADPRIVATE(diagflux_on) … … 26 26 ll = MERGE(llm,1,diagflux_on) 27 27 CALL allocate_field(f_masst, field_t,type_real,ll, name="masst") 28 CALL allocate_field(f_ulont, field_t,type_real,ll, name="ulont") 29 CALL allocate_field(f_thetat, field_t,type_real,ll, name="thetat") 28 30 CALL allocate_field(f_epot, field_t,type_real,ll, name="epot") 29 31 CALL allocate_field(f_ekin, field_t,type_real,ll, name="ekin") … … 31 33 CALL allocate_field(f_qmasst, field_t,type_real,ll,nqtot, name="qmasst") 32 34 CALL allocate_field(f_massfluxt, field_u,type_real,ll, name="massfluxt") 35 CALL allocate_field(f_ulonfluxt, field_u,type_real,ll, name="ulonfluxt") 36 CALL allocate_field(f_thetafluxt, field_u,type_real,ll, name="thetafluxt") 33 37 CALL allocate_field(f_epotfluxt, field_u,type_real,ll, name="epotfluxt") 34 38 CALL allocate_field(f_ekinfluxt, field_u,type_real,ll, name="ekinfluxt") … … 50 54 CALL swap_dimensions(ind) 51 55 ZERO2(f_masst) 56 ZERO2(f_ulont) 57 ZERO2(f_thetat) 52 58 ZERO2(f_epot) 53 59 ZERO2(f_ekin) … … 55 61 ZERO3(f_qmasst) 56 62 ZERO2(f_massfluxt) 63 ZERO2(f_ulonfluxt) 64 ZERO2(f_thetafluxt) 57 65 ZERO2(f_epotfluxt) 58 66 ZERO2(f_ekinfluxt) … … 110 118 !------------------------------------ Compute energy fluxes --------------------------------------- 111 119 112 SUBROUTINE diagflux_energy(frac, f_phis,f_rhodz,f_theta_rhodz,f_u, f_geopot,f_theta, f_hfluxt)120 SUBROUTINE diagflux_energy(frac, f_phis,f_rhodz,f_theta_rhodz,f_u, f_geopot,f_theta,f_pk, f_hfluxt) 113 121 REAL(rstd), INTENT(IN) :: frac 114 TYPE(t_field),POINTER :: f_phis(:),f_rhodz(:),f_theta_rhodz(:),f_u(:), f_geopot(:), f_theta(:), f_ hfluxt(:)122 TYPE(t_field),POINTER :: f_phis(:),f_rhodz(:),f_theta_rhodz(:),f_u(:), f_geopot(:), f_theta(:), f_pk(:), f_hfluxt(:) 115 123 REAL(rstd), POINTER :: phis(:), rhodz(:,:), theta_rhodz(:,:,:), u(:,:), & 116 geopot(:,:), pk(:,:,:), hfluxt(:,:), &117 epot(:,:), ekin(:,:), enthalpy(:,:), &118 epotflux(:,:), ekinflux(:,:), enthalpyflux(:,:)124 geopot(:,:), theta(:,:,:), pk(:,:), hfluxt(:,:), & 125 ulont(:,:), thetat(:,:), epot(:,:), ekin(:,:), enthalpy(:,:), & 126 thetaflux(:,:), ulonflux(:,:), epotflux(:,:), ekinflux(:,:), enthalpyflux(:,:) 119 127 INTEGER :: ind 120 128 DO ind=1,ndomain … … 128 136 u = f_u(ind) 129 137 geopot = f_geopot(ind) 130 pk = f_theta(ind) ! buffer 138 theta = f_theta(ind) ! buffer 139 pk = f_pk(ind) ! buffer 140 ulont = f_ulont(ind) 141 thetat = f_thetat(ind) 131 142 epot = f_epot(ind) 132 143 ekin = f_ekin(ind) 133 144 enthalpy = f_enthalpy(ind) 145 ulonflux = f_ulonfluxt(ind) 146 thetaflux = f_thetafluxt(ind) 134 147 epotflux = f_epotfluxt(ind) 135 148 ekinflux = f_ekinfluxt(ind) 136 149 enthalpyflux = f_enthalpyfluxt(ind) 137 CALL compute_diagflux_energy(frac,hfluxt, phis,rhodz,theta_rhodz,u, geopot,pk, epot,ekin,enthalpy, epotflux, ekinflux, enthalpyflux) 150 CALL compute_diagflux_energy(frac,hfluxt, phis,rhodz,theta_rhodz,u, geopot,theta,pk, & 151 ulont, thetat, epot, ekin, enthalpy, & 152 ulonflux, thetaflux, epotflux, ekinflux, enthalpyflux) 138 153 END DO 139 154 END SUBROUTINE diagflux_energy 140 155 141 SUBROUTINE compute_diagflux_energy(frac, massflux, phis,rhodz,theta_rhodz,u, geopot,pk, epot,ekin,enthalpy, epot_flux, ekin_flux, enthalpy_flux) 156 SUBROUTINE compute_diagflux_energy(frac, massflux, phis,rhodz,theta_rhodz,ue, geopot,theta,pk, & 157 ulon, thetat, epot, ekin, enthalpy, & 158 ulon_flux, thetat_flux, epot_flux, ekin_flux, enthalpy_flux) 142 159 USE disvert_mod, ONLY : ptop 143 160 REAL(rstd), INTENT(IN) :: frac 144 REAL(rstd), INTENT(IN) :: massflux(3*iim*jjm,llm), u (3*iim*jjm,llm),&161 REAL(rstd), INTENT(IN) :: massflux(3*iim*jjm,llm), ue(3*iim*jjm,llm),& 145 162 phis(iim*jjm), rhodz(iim*jjm,llm), theta_rhodz(iim*jjm,llm,nqtot) 146 REAL(rstd), INTENT(INOUT) :: geopot(iim*jjm,llm+1), pk(iim*jjm,llm) ! pk = buffer147 REAL(rstd), INTENT(INOUT), DIMENSION(iim*jjm, llm) :: epot, ekin, enthalpy148 REAL(rstd), INTENT(INOUT), DIMENSION(3*iim*jjm, llm) :: epot_flux, ekin_flux, enthalpy_flux149 REAL(rstd) :: energy, p_ik, theta_ik, temp_ik, gv, Rd 163 REAL(rstd), INTENT(INOUT) :: geopot(iim*jjm,llm+1), theta(iim*jjm,llm), pk(iim*jjm,llm) ! theta,pk = buffers 164 REAL(rstd), INTENT(INOUT), DIMENSION(iim*jjm, llm) :: ulon, thetat, epot, ekin, enthalpy 165 REAL(rstd), INTENT(INOUT), DIMENSION(3*iim*jjm, llm) :: ulon_flux, thetat_flux, epot_flux, ekin_flux, enthalpy_flux 166 REAL(rstd) :: energy, p_ik, theta_ik, temp_ik, gv, Rd, cx,cy,cz, ux,uy,uz, ue_le,ulon_i 150 167 INTEGER :: ij, l, ij_omp_begin_ext, ij_omp_end_ext 151 168 Rd = kappa*cpp 152 169 ! even if loops are of the _ext variant, we still need halo exchanges before reconstructing fluxes at cell centers 153 170 ! => loop over interior region 154 CALL distrib_level(ij_end-ij_begin+1,ij_omp_begin_ext,ij_omp_end_ext) 155 ij_omp_begin_ext = ij_omp_begin_ext+ij_begin-1 156 ij_omp_end_ext = ij_omp_end_ext+ij_begin-1 171 CALL distrib_level(ij_begin_ext, ij_end_ext, ij_omp_begin_ext,ij_omp_end_ext) 157 172 #include "../kernels/energy_fluxes.k90" 158 173 END SUBROUTINE compute_diagflux_energy -
codes/icosagcm/trunk/src/diagnostics/observable.f90
r599 r604 1 1 MODULE observable_mod 2 2 USE icosa 3 USE diagflux_mod 4 USE output_field_mod 3 5 IMPLICIT NONE 4 6 PRIVATE … … 38 40 USE disvert_mod 39 41 USE wind_mod 40 USE output_field_mod41 42 USE omp_para 42 43 USE time_mod … … 47 48 USE theta2theta_rhodz_mod 48 49 USE omega_mod 49 USE diagflux_mod50 50 LOGICAL, INTENT(IN) :: init 51 51 INTEGER :: l … … 166 166 CALL output_field("massflux_lat",f_buf_ulat) 167 167 168 CALL transfert_request(f_epotfluxt,req_e1_vect) 169 CALL flux_centered_lonlat(1./(itau_out*dt) , f_epotfluxt, f_buf_ulon, f_buf_ulat) 170 CALL output_field("epot_t", f_epot) 171 CALL output_field("epotflux_lon",f_buf_ulon) 172 CALL output_field("epotflux_lat",f_buf_ulat) 173 174 CALL transfert_request(f_ekinfluxt,req_e1_vect) 175 CALL flux_centered_lonlat(1./(itau_out*dt) , f_ekinfluxt, f_buf_ulon, f_buf_ulat) 176 CALL output_field("ekin_t", f_ekin) 177 CALL output_field("ekinflux_lon",f_buf_ulon) 178 CALL output_field("ekinflux_lat",f_buf_ulat) 179 180 CALL transfert_request(f_enthalpyfluxt,req_e1_vect) 181 CALL flux_centered_lonlat(1./(itau_out*dt) , f_enthalpyfluxt, f_buf_ulon, f_buf_ulat) 182 CALL output_field("enthalpy_t", f_enthalpy) 183 CALL output_field("enthalpyflux_lon",f_buf_ulon) 184 CALL output_field("enthalpyflux_lat",f_buf_ulat) 168 CALL output_energyflux(f_ulont, f_ulonfluxt, "ulon_t", "ulonflux_lon", "ulonflux_lat") 169 CALL output_energyflux(f_thetat, f_thetafluxt, "theta_t", "thetaflux_lon", "thetaflux_lat") 170 CALL output_energyflux(f_epot, f_epotfluxt, "epot_t", "epotflux_lon", "epotflux_lat") 171 CALL output_energyflux(f_ekin, f_ekinfluxt, "ekin_t", "ekinflux_lon", "ekinflux_lat") 172 CALL output_energyflux(f_enthalpy, f_enthalpyfluxt, "enthalpy_t", "enthalpyflux_lon", "enthalpyflux_lat") 185 173 186 174 CALL qflux_centered_lonlat(1./(itau_out*dt) , f_qfluxt, f_qfluxt_lon, f_qfluxt_lat) … … 192 180 END IF 193 181 END SUBROUTINE write_output_fields_basic 182 183 SUBROUTINE output_energyflux(f_energy, f_flux, name_energy, name_fluxlon, name_fluxlat) 184 TYPE(t_field), POINTER :: f_energy(:), f_flux(:) 185 CHARACTER(*), INTENT(IN) :: name_energy, name_fluxlon, name_fluxlat 186 CALL transfert_request(f_flux,req_e1_vect) 187 CALL flux_centered_lonlat(1./(itau_out*dt) , f_flux, f_buf_ulon, f_buf_ulat) 188 CALL output_field(name_energy, f_energy) 189 CALL output_field(name_fluxlon, f_buf_ulon) 190 CALL output_field(name_fluxlat, f_buf_ulat) 191 END SUBROUTINE output_energyflux 194 192 195 193 !------------------- Conversion from prognostic to observable variables ------------------
Note: See TracChangeset
for help on using the changeset viewer.