[Dart-dev] DART/trunk Revision: 11844
dart at ucar.edu
dart at ucar.edu
Wed Jul 26 17:03:51 MDT 2017
thoar at ucar.edu
2017-07-26 17:03:48 -0600 (Wed, 26 Jul 2017)
123
Adding (untested) support for reading a mean dynamic topography field.
In support of assimilating the AVISO observations.
Modified: DART/trunk/models/ROMS/model_mod.f90
===================================================================
--- DART/trunk/models/ROMS/model_mod.f90 2017-07-26 22:41:51 UTC (rev 11843)
+++ DART/trunk/models/ROMS/model_mod.f90 2017-07-26 23:03:48 UTC (rev 11844)
@@ -50,12 +50,12 @@
nc_check, do_output, to_upper, &
find_namelist_in_file, check_namelist_read, &
open_file, file_exist, find_textfile_dims, &
- file_to_text, do_output,close_file
+ file_to_text, close_file
use obs_kind_mod, only : KIND_TEMPERATURE, KIND_SALINITY, KIND_DRY_LAND, &
- KIND_U_CURRENT_COMPONENT, &
- KIND_V_CURRENT_COMPONENT, KIND_SEA_SURFACE_HEIGHT, &
- KIND_SEA_SURFACE_PRESSURE, &
+ KIND_U_CURRENT_COMPONENT, KIND_V_CURRENT_COMPONENT, &
+ KIND_SEA_SURFACE_HEIGHT, KIND_SEA_SURFACE_PRESSURE, &
+ KIND_MEAN_DYNAMIC_TOPOGRAPHY, &
KIND_POTENTIAL_TEMPERATURE, &
paramname_length,get_raw_obs_kind_index, &
get_raw_obs_kind_name,get_obs_kind_var_type
@@ -120,6 +120,8 @@
character(len=32) :: calendar = 'Gregorian'
character(len=256) :: model_restart_filename = 'roms_restart.nc'
character(len=256) :: grid_definition_filename = 'roms_grid.nc'
+character(len=256) :: mdt_reference_file_name = 'none'
+character(len=256) :: mdt_reference_var_name = 'none'
real(r8) :: hc=50.0_r8
namelist /model_nml/ &
@@ -131,6 +133,8 @@
hc, &
model_restart_filename, &
grid_definition_filename, &
+ mdt_reference_file_name, &
+ mdt_reference_var_name, &
vert_localization_coord, &
debug, &
variables
@@ -203,7 +207,8 @@
TLAT(:,:), TLON(:,:), &
VLAT(:,:), VLON(:,:), &
PM(:,:), PN(:,:), &
- ANGL(:,:), HT(:,:), ZC(:,:,:)
+ ANGL(:,:), HT(:,:), &
+ MDT(:), ZC(:,:,:)
integer, parameter :: i2 = SELECTED_INT_KIND(2) ! need something to coerce to NF90_SHORT
integer(i2), allocatable :: mask_rho(:,:), &
@@ -486,6 +491,13 @@
endif
obs_kind = obs_type
+
+if( obs_kind == KIND_MEAN_DYNAMIC_TOPOGRAPHY ) then
+ call lon_lat_interpolate(MDT, llon, llat, &
+ obs_type, Ns_rho, interp_val, istatus)
+ return
+endif
+
ivar = get_progvar_index_from_kind(obs_kind)
! Do horizontal interpolations for the appropriate levels
@@ -659,6 +671,11 @@
call get_grid_dimensions()
call get_grid()
+if (mdt_reference_file_name /= 'none') then
+ allocate( MDT(Nx*Ny))
+ call read_mean_dynamic_topography()
+endif
+
call nc_check( nf90_open(trim(model_restart_filename), NF90_NOWRITE, ncid), &
'static_init_model', 'open '//trim(model_restart_filename))
@@ -837,6 +854,7 @@
if (allocated(PM)) deallocate(PM)
if (allocated(PN)) deallocate(PN)
if (allocated(ANGL)) deallocate(ANGL)
+if (allocated(MDT)) deallocate(MDT)
if (allocated(ZC)) deallocate(ZC)
end subroutine end_model
@@ -4561,6 +4579,127 @@
end function get_dimension_length
+!------------------------------------------------------------------
+!> Open and read the mean dynamic sea surface topography
+!> There is an assumed name and the shape of the variable must
+!> match the (horizontal) ROMS grid being used. The hope is that
+!> that actual locations MUST MATCH EXACTLY the ROMS grid.
+
+subroutine read_mean_dynamic_topography()
+
+integer :: ncid, VarID, io, xtype, ii
+integer :: numdims, dimIDs(NF90_MAX_DIMS), dimlen
+character(len=128) :: unitsstring
+real(r4) :: rmiss
+real(r8) :: dmiss, dmin, dmax
+character(len=NF90_MAX_NAME) :: varname
More information about the Dart-dev
mailing list