Commit a865fa53 authored by Thomas Dubos's avatar Thomas Dubos Committed by Thomas Dubos
Browse files

temperature2theta_rhodz for unstructured mesh

parent e6e327d6
......@@ -62,7 +62,7 @@ CONTAINS
END SUBROUTINE init_grid_param
{%- set diags=('rhodz','pression', 'pression_mid', 'exner',
'temperature', 'theta_rhodz2temperature',
'temperature', 'theta_rhodz2temperature', 'temperature2theta_rhodz',
'un2ulonlat', 'velocity','vorticity','divergence', 'hydrostatic_pressure', 'vertical_interp',
'pvort_only','theta','geopot', 'caldyn_fast','caldyn_slow_hydro','caldyn_coriolis','caldyn_vert',
'accumulate_fluxes', 'advect_horiz', 'vlz') %}
......
......@@ -104,6 +104,8 @@ CONTAINS
compute_theta_rhodz2temperature => compute_theta_rhodz2temperature_hex
compute_temperature2theta_rhodz => compute_temperature2theta_rhodz_hex
compute_un2ulonlat => compute_un2ulonlat_hex
compute_velocity => compute_velocity_hex
......@@ -181,6 +183,8 @@ CONTAINS
compute_theta_rhodz2temperature => compute_theta_rhodz2temperature_unst
compute_temperature2theta_rhodz => compute_temperature2theta_rhodz_unst
compute_un2ulonlat => compute_un2ulonlat_unst
compute_velocity => compute_velocity_unst
......
......@@ -73,6 +73,14 @@ MODULE compute_diagnostics_mod
REAL(rstd),INTENT(IN) :: pval
END SUBROUTINE comp_vert_interp
SUBROUTINE comp_theta2theta_rhodz(ps,theta, theta_rhodz, offset, ondevice)
IMPORT
REAL(rstd), INTENT(IN) :: ps(:), theta(:,:)
REAL(rstd), INTENT(OUT) :: theta_rhodz(:,:)
INTEGER, INTENT(IN) :: offset
LOGICAL, INTENT(IN) :: ondevice
END SUBROUTINE comp_theta2theta_rhodz
SUBROUTINE comp_theta_rhodz2temperature(p, theta_rhodz, temp, offset)
IMPORT
REAL(rstd), INTENT(IN) :: p(:,:), theta_rhodz(:,:)
......@@ -80,13 +88,12 @@ MODULE compute_diagnostics_mod
INTEGER,INTENT(IN) :: offset
END SUBROUTINE comp_theta_rhodz2temperature
SUBROUTINE comp_theta2theta_rhodz(ps,theta, theta_rhodz, offset, ondevice)
SUBROUTINE comp_temperature2theta_rhodz(p, temp, theta_rhodz, offset)
IMPORT
REAL(rstd), INTENT(IN) :: ps(:), theta(:,:)
REAL(rstd), INTENT(IN) :: p(:,:), temp(:,:)
REAL(rstd), INTENT(OUT) :: theta_rhodz(:,:)
INTEGER, INTENT(IN) :: offset
LOGICAL, INTENT(IN) :: ondevice
END SUBROUTINE comp_theta2theta_rhodz
END SUBROUTINE comp_temperature2theta_rhodz
END INTERFACE
......@@ -101,12 +108,14 @@ MODULE compute_diagnostics_mod
PROCEDURE(comp_hydro_press), POINTER, SAVE :: compute_hydrostatic_pressure => NULL()
PROCEDURE(comp_vert_interp), POINTER, SAVE :: compute_vertical_interp => NULL()
PROCEDURE(comp_theta_rhodz2temperature), POINTER, SAVE :: compute_theta_rhodz2temperature => NULL()
PROCEDURE(comp_theta2theta_rhodz), POINTER, SAVE :: compute_theta2theta_rhodz => NULL()
PROCEDURE(comp_theta_rhodz2temperature), POINTER, SAVE :: compute_theta_rhodz2temperature => NULL()
PROCEDURE(comp_temperature2theta_rhodz), POINTER, SAVE :: compute_temperature2theta_rhodz => NULL()
PUBLIC :: compute_rhodz, compute_pression, compute_pression_mid, compute_exner, compute_temperature, &
compute_velocity, compute_un2ulonlat, compute_vorticity, compute_divergence, &
compute_hydrostatic_pressure, compute_vertical_interp, &
compute_theta_rhodz2temperature, compute_theta2theta_rhodz
compute_theta2theta_rhodz, compute_theta_rhodz2temperature, compute_temperature2theta_rhodz
END MODULE compute_diagnostics_mod
......@@ -5,11 +5,11 @@ MODULE theta2theta_rhodz_mod
TYPE(t_field), POINTER, SAVE :: f_p(:)
PUBLIC :: init_theta2theta_rhodz, &
theta_rhodz2theta, compute_theta_rhodz2theta, temperature2theta_rhodz, &
theta2theta_rhodz, theta_rhodz2temperature, &
compute_theta2theta_rhodz_hex, compute_theta2theta_rhodz_unst, &
compute_theta_rhodz2temperature_hex, compute_theta_rhodz2temperature_unst
PUBLIC :: init_theta2theta_rhodz, &
theta_rhodz2theta, compute_theta_rhodz2theta, &
theta2theta_rhodz, compute_theta2theta_rhodz_hex, compute_theta2theta_rhodz_unst, &
theta_rhodz2temperature, compute_theta_rhodz2temperature_hex, compute_theta_rhodz2temperature_unst, &
temperature2theta_rhodz, compute_temperature2theta_rhodz_hex, compute_temperature2theta_rhodz_unst
CONTAINS
......@@ -258,7 +258,7 @@ CONTAINS
!------------------------------------------------------------------------
SUBROUTINE temperature2theta_rhodz(f_ps,f_temp,f_theta_rhodz)
USE compute_diagnostics_mod, ONLY : compute_pression
USE compute_diagnostics_mod, ONLY : compute_pression, compute_temperature2theta_rhodz
TYPE(t_field), POINTER :: f_ps(:)
TYPE(t_field), POINTER :: f_theta_rhodz(:)
TYPE(t_field), POINTER :: f_temp(:)
......@@ -287,7 +287,21 @@ CONTAINS
END SUBROUTINE temperature2theta_rhodz
SUBROUTINE compute_temperature2theta_rhodz(p,temp,theta_rhodz,offset)
SUBROUTINE compute_temperature2theta_rhodz_hex(p, temp, theta_rhodz, offset)
REAL(rstd),INTENT(IN) :: p(:,:), temp(:,:)
REAL(rstd),INTENT(OUT) :: theta_rhodz(:,:)
INTEGER,INTENT(IN) :: offset
CALL compute_temperature2theta_rhodz_hex_(p, temp,theta_rhodz, offset)
END SUBROUTINE compute_temperature2theta_rhodz_hex
SUBROUTINE compute_temperature2theta_rhodz_unst(p,temp,theta_rhodz, offset)
REAL(rstd),INTENT(IN) :: p(:,:), temp(:,:)
REAL(rstd),INTENT(OUT) :: theta_rhodz(:,:)
INTEGER,INTENT(IN) :: offset
CALL compute_temperature2theta_rhodz_unst_(p,temp,theta_rhodz)
END SUBROUTINE compute_temperature2theta_rhodz_unst
SUBROUTINE compute_temperature2theta_rhodz_hex_(p, temp, theta_rhodz, offset)
USE exner_mod
USE omp_para
REAL(rstd),INTENT(IN) :: p(iim*jjm,llm+1)
......@@ -312,7 +326,22 @@ CONTAINS
ENDDO
!$OMP BARRIER
END SUBROUTINE compute_temperature2theta_rhodz
END SUBROUTINE compute_temperature2theta_rhodz_hex_
SUBROUTINE compute_temperature2theta_rhodz_unst_(p, temp, theta_rhodz)
FIELD_W, INTENT(IN) :: p
FIELD_MASS, INTENT(IN) :: temp
FIELD_MASS, INTENT(OUT) :: theta_rhodz
REAL(rstd) :: pk_ij
INTEGER :: ij,l
!$OMP DO SCHEDULE(STATIC)
DO ij=1, primal_num
DO l=1,llm
pk_ij=((.5/preff)*(p(l,ij)+p(l+1,ij)))**kappa
theta_rhodz(l,ij) = temp(l,ij) * ((p(l,ij)-p(l+1,ij))/g) / pk_ij
ENDDO
ENDDO
END SUBROUTINE compute_temperature2theta_rhodz_unst_
END MODULE theta2theta_rhodz_mod
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment