chgres_cube  1.12.0
 All Data Structures Files Functions Variables
atmosphere_target_data.F90
Go to the documentation of this file.
1 
4 
10 
11  use esmf
12 
13  implicit none
14 
15  private
16 
17  integer, public :: lev_target
18  integer, public :: levp1_target
19  integer, public :: nvcoord_target
20 
21  real(esmf_kind_r8), allocatable, public :: vcoord_target(:,:)
22 
23  type(esmf_field), public :: delp_target_grid
24  type(esmf_field), public :: dzdt_target_grid
25  type(esmf_field), public :: ps_target_grid
26  type(esmf_field), public :: temp_target_grid
27  type(esmf_field), allocatable, public :: tracers_target_grid(:)
28  type(esmf_field), public :: u_s_target_grid
29  type(esmf_field), public :: v_s_target_grid
30  type(esmf_field), public :: u_w_target_grid
31  type(esmf_field), public :: v_w_target_grid
32  type(esmf_field), public :: zh_target_grid
33  type(esmf_field), public :: qnifa_climo_target_grid
35  type(esmf_field), public :: qnwfa_climo_target_grid
37 
39 
40  contains
41 
46 
47  use program_setup, only : num_tracers
48 
49  implicit none
50 
51  integer :: i, rc
52 
53  print*,"- DESTROY TARGET GRID ATMOSPHERIC FIELDS."
54 
55  if (esmf_fieldiscreated(delp_target_grid)) call esmf_fielddestroy(delp_target_grid, rc=rc)
56  if (esmf_fieldiscreated(dzdt_target_grid)) call esmf_fielddestroy(dzdt_target_grid, rc=rc)
57  if (esmf_fieldiscreated(ps_target_grid)) call esmf_fielddestroy(ps_target_grid, rc=rc)
58  if (esmf_fieldiscreated(temp_target_grid)) call esmf_fielddestroy(temp_target_grid, rc=rc)
59  if (esmf_fieldiscreated(u_s_target_grid)) call esmf_fielddestroy(u_s_target_grid, rc=rc)
60  if (esmf_fieldiscreated(v_s_target_grid)) call esmf_fielddestroy(v_s_target_grid, rc=rc)
61  if (esmf_fieldiscreated(u_w_target_grid)) call esmf_fielddestroy(u_w_target_grid, rc=rc)
62  if (esmf_fieldiscreated(v_w_target_grid)) call esmf_fielddestroy(v_w_target_grid, rc=rc)
63  if (esmf_fieldiscreated(zh_target_grid)) call esmf_fielddestroy(zh_target_grid, rc=rc)
64 
65  do i = 1, num_tracers
66  if (esmf_fieldiscreated(tracers_target_grid(i))) call esmf_fielddestroy(tracers_target_grid(i), rc=rc)
67  enddo
68 
69  if (allocated (tracers_target_grid)) deallocate(tracers_target_grid)
70 
71  if (esmf_fieldiscreated(qnifa_climo_target_grid)) then
72  call esmf_fielddestroy(qnifa_climo_target_grid, rc=rc)
73  endif
74 
75  if (esmf_fieldiscreated(qnwfa_climo_target_grid)) then
76  call esmf_fielddestroy(qnwfa_climo_target_grid, rc=rc)
77  endif
78 
79  if (allocated (vcoord_target)) deallocate(vcoord_target)
80 
81  end subroutine cleanup_atmosphere_target_data
82 
83  end module atmosphere_target_data
subroutine, public cleanup_atmosphere_target_data
Free up memory for fields and variables in this module.
Module to hold variables and ESMF fields associated with the target grid atmospheric data...
This module contains code to read the setup namelist file, handle the varmap file for GRIB2 data...