[Dart-dev] DART/branches Revision: 11956
dart at ucar.edu
dart at ucar.edu
Tue Sep 26 13:47:17 MDT 2017
thoar at ucar.edu
2017-09-26 13:47:16 -0600 (Tue, 26 Sep 2017)
162
Using some doxygen style commenting between routines (that i had lying about)
and making sure the initialize_module() routines do not get called more than once.
Modified: DART/branches/mizzi/models/wrf_chem/WRF_DART_utilities/dart_to_wrf.f90
===================================================================
--- DART/branches/mizzi/models/wrf_chem/WRF_DART_utilities/dart_to_wrf.f90 2017-09-25 21:33:51 UTC (rev 11955)
+++ DART/branches/mizzi/models/wrf_chem/WRF_DART_utilities/dart_to_wrf.f90 2017-09-26 19:47:16 UTC (rev 11956)
@@ -315,7 +315,7 @@
!
! APM: +++
! APM: code to reverse log10(x*1.e-6) transform of CO chemistry field
- if (use_log_co.eq..TRUE. .and. trim(my_field).eq.'co') then
+ if (use_log_co .and. trim(my_field).eq.'co') then
! print *, 'APM: dart_to_wrf 2D CO conversion '
do jj=1,wrf%var_size(2,ind)
do ii=1,wrf%var_size(1,ind)
@@ -402,7 +402,7 @@
!
! APM: +++
! APM: code to reverse log10(x*1.e-6) transform of CO chemistry field
- if (use_log_co.eq..TRUE. .and. trim(my_field).eq.'co') then
+ if (use_log_co .and. trim(my_field).eq.'co') then
! print *, 'APM: dart_to_wrf 3D CO conversion '
do kk=1,wrf%var_size(3,ind)
do jj=1,wrf%var_size(2,ind)
Modified: DART/branches/mizzi/obs_def/obs_def_IASI_CO_mod.f90
===================================================================
--- DART/branches/mizzi/obs_def/obs_def_IASI_CO_mod.f90 2017-09-25 21:33:51 UTC (rev 11955)
+++ DART/branches/mizzi/obs_def/obs_def_IASI_CO_mod.f90 2017-09-26 19:47:16 UTC (rev 11956)
@@ -40,7 +40,9 @@
! END DART PREPROCESS SET_OBS_DEF_IASI_CO
!
! BEGIN DART PREPROCESS MODULE CODE
+
module obs_def_iasi_CO_mod
+
use types_mod, only : r8
use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, &
nmlfileunit, check_namelist_read, &
@@ -60,9 +62,9 @@
set_obs_def_iasi_co
! Storage for the special information required for observations of this type
-integer, parameter :: max_iasi_co_obs = 10000000
-integer, parameter :: iasi_dim = 19
-integer, parameter :: iasi_dimp = 20
+integer, parameter :: MAX_IASI_CO_OBS = 10000000
+integer, parameter :: IASI_DIM = 19
+integer, parameter :: IASI_DIMP = 20
integer :: num_iasi_co_obs = 0
real(r8), allocatable, dimension(:,:) :: avg_kernel
@@ -82,7 +84,7 @@
logical, save :: module_initialized = .false.
integer :: counts1 = 0
-!
+
character(len=129) :: IASI_CO_retrieval_type
logical :: use_log_co=.false.
!
@@ -95,21 +97,24 @@
contains
!----------------------------------------------------------------------
+!>
- subroutine initialize_module
-!----------------------------------------------------------------------------
-! subroutine initialize_module
+subroutine initialize_module
integer :: iunit, rc
+
+! Prevent multiple calls from executing this code more than once.
+if (module_initialized) return
+
call register_module(source, revision, revdate)
module_initialized = .true.
-allocate(avg_kernel(max_iasi_co_obs,iasi_dim))
-allocate(pressure(max_iasi_co_obs,iasi_dimp))
-allocate(iasi_prior(max_iasi_co_obs))
-allocate(iasi_psurf(max_iasi_co_obs))
-allocate(iasi_nlevels(max_iasi_co_obs))
-allocate(iasi_nlevelsp(max_iasi_co_obs))
+allocate(avg_kernel( MAX_IASI_CO_OBS, IASI_DIM))
+allocate(pressure( MAX_IASI_CO_OBS, IASI_DIMP))
+allocate(iasi_prior( MAX_IASI_CO_OBS))
+allocate(iasi_psurf( MAX_IASI_CO_OBS))
+allocate(iasi_nlevels( MAX_IASI_CO_OBS))
+allocate(iasi_nlevelsp(MAX_IASI_CO_OBS))
! Read the namelist entry.
IASI_CO_retrieval_type='RETR'
@@ -137,8 +142,8 @@
integer :: iasi_nlevelsp_1
real(r8) :: iasi_prior_1
real(r8) :: iasi_psurf_1
-real(r8), dimension(iasi_dim) :: avg_kernels_1
-real(r8), dimension(iasi_dimp) :: pressure_1
+real(r8), dimension(IASI_DIM) :: avg_kernels_1
+real(r8), dimension(IASI_DIMP) :: pressure_1
More information about the Dart-dev
mailing list