[Dart-dev] [3602] DART/trunk/models/MITgcm_ocean:
Added support for platform-specific observations.
nancy at ucar.edu
nancy at ucar.edu
Fri Sep 5 16:55:31 MDT 2008
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/dart-dev/attachments/20080905/44a7c286/attachment.html
-------------- next part --------------
Modified: DART/trunk/models/MITgcm_ocean/create_ocean_obs.f90
===================================================================
--- DART/trunk/models/MITgcm_ocean/create_ocean_obs.f90 2008-09-05 22:44:29 UTC (rev 3601)
+++ DART/trunk/models/MITgcm_ocean/create_ocean_obs.f90 2008-09-05 22:55:31 UTC (rev 3602)
@@ -35,8 +35,6 @@
type(obs_sequence_type) :: seq
-character(len = 129) :: output_name
-character(len = 8 ) :: obsdate
integer :: iunit, io, day1
! ----------------------------------------------------------------------
@@ -46,31 +44,20 @@
integer :: year = 1996, month =1, day =1, tot_days = 31
integer :: max_num = 800000
character(len = 129) :: fname = 'raw_ocean_obs.txt'
+character(len = 129) :: output_name = 'raw_ocean_obs_seq.out'
-logical :: ADCP = .false., DRIFTERS = .false., GLIDERS = .false., &
- TMI = .false., SSH = .false.
-
real(r8) :: lon1 = 0.0_r8, & ! lower longitude bound
lon2 = 360.0_r8, & ! upper longitude bound
lat1 = -90.0_r8, & ! lower latitude bound
lat2 = 90.0_r8 ! upper latitude bound
namelist /ocean_obs_nml/ year, month, day, tot_days, max_num, &
- fname, ADCP, DRIFTERS, GLIDERS, TMI, SSH, &
- lon1, lon2, lat1, lat2
+ fname, output_name, lon1, lon2, lat1, lat2
! ----------------------------------------------------------------------
-! ADPUPA: upper-air reports (mostly radiosonde plus few dropsonde, PIBAL)
-! AIRCFT: Conv. (AIREP, PIREP) and ASDAR aircraft reports
-! AIRCAR: ACARS sircraft reports
-! SATEMP: ATOVS retrived temperature
-! SFCSHP: SURFACE MARINE reports
-! ADPSFC: SURFACE LAND SYNOPTIC STATION reports
-! SATWND: Satellite derived wind reports
+! start of executable program code
! ----------------------------------------------------------------------
-! start of executable program code
-
call initialize_utilities('create_ocean_obs')
call register_module(source,revision,revdate)
@@ -92,19 +79,14 @@
lon2 = min(max(lon2,0.0_r8),360.0_r8)
if ( lon1 > lon2 ) lon2 = lon2 + 360.0_r8
- ! define observation filename
- write(obsdate, '(i4.4,i2.2)') year, month
+! The file is read and parsed into a DART observation sequence linked list
+seq = real_obs_sequence(fname, year, month, day1, max_num, &
+ lon1, lon2, lat1, lat2)
- seq = real_obs_sequence(fname, year, month, day1, max_num, &
- ADCP, DRIFTERS, GLIDERS, TMI, SSH, &
- lon1, lon2, lat1, lat2)
+call write_obs_seq(seq, output_name)
- output_name = 'obs_seq'//obsdate
- call write_obs_seq(seq, output_name)
+call destroy_obs_sequence(seq) ! release the memory of the seq.
- ! release the memory of the seq.
- call destroy_obs_sequence(seq)
-
call timestamp(source,revision,revdate,'end') ! close the log file.
end program create_ocean_obs
Modified: DART/trunk/models/MITgcm_ocean/create_ocean_obs.nml
===================================================================
--- DART/trunk/models/MITgcm_ocean/create_ocean_obs.nml 2008-09-05 22:44:29 UTC (rev 3601)
+++ DART/trunk/models/MITgcm_ocean/create_ocean_obs.nml 2008-09-05 22:55:31 UTC (rev 3602)
@@ -5,11 +5,7 @@
tot_days = 31,
max_num = 80000,
fname = 'raw_ocean_obs.txt',
- ADCP = .true.,
- DRIFTERS = .true.,
- GLIDERS = .true.,
- TMI = .true.,
- SSH = .true.,
+ fname = 'raw_ocean_obs_seq.out',
lon1 = 0.0,
lon2 = 360.0,
lat1 = -90.0,
Modified: DART/trunk/models/MITgcm_ocean/ocean_obs_mod.f90
===================================================================
--- DART/trunk/models/MITgcm_ocean/ocean_obs_mod.f90 2008-09-05 22:44:29 UTC (rev 3601)
+++ DART/trunk/models/MITgcm_ocean/ocean_obs_mod.f90 2008-09-05 22:55:31 UTC (rev 3602)
@@ -18,27 +18,18 @@
set_obs_def_error_variance, set_obs_def_location
use time_manager_mod, only : time_type, get_date, set_time, GREGORIAN, &
set_date, set_calendar_type, get_time, &
- operator(==)
+ print_date, print_time, operator(==)
use utilities_mod, only : get_unit, open_file, close_file, file_exist, &
register_module, error_handler, &
E_ERR, E_MSG, timestamp
use location_mod, only : location_type, set_location, VERTISHEIGHT, VERTISSURFACE
use obs_sequence_mod, only : init_obs_sequence, init_obs, insert_obs_in_seq, &
set_obs_values, set_qc, obs_sequence_type, obs_type, &
- copy_obs, set_copy_meta_data, set_qc_meta_data, set_obs_def
+ copy_obs, set_copy_meta_data, set_qc_meta_data, set_obs_def, &
+ get_first_obs, get_last_obs, get_obs_def
-use obs_kind_mod, only : KIND_SALINITY, &
- KIND_TEMPERATURE, &
- KIND_U_WIND_COMPONENT, &
- KIND_V_WIND_COMPONENT, &
- KIND_SEA_SURFACE_HEIGHT
+use obs_kind_mod, only : get_obs_kind_index
-use obs_kind_mod, only : SALINITY
-use obs_kind_mod, only : TEMPERATURE
-use obs_kind_mod, only : U_CURRENT_COMPONENT
-use obs_kind_mod, only : V_CURRENT_COMPONENT
-use obs_kind_mod, only : SEA_SURFACE_HEIGHT
-
implicit none
private
@@ -62,19 +53,18 @@
!-------------------------------------------------
function real_obs_sequence (obsfile, year, month, day, max_num, &
- ADCP, DRIFTERS, GLIDERS, TMI, SSH, &
lon1, lon2, lat1, lat2)
!------------------------------------------------------------------------------
! this function is to prepare data to DART sequence format
!
character(len=129), intent(in) :: obsfile
integer, intent(in) :: year, month, day, max_num
-logical, intent(in) :: ADCP, DRIFTERS, GLIDERS, TMI, SSH
real(r8), intent(in) :: lon1, lon2, lat1, lat2
type(obs_sequence_type) :: real_obs_sequence
+type(obs_def_type) :: obs_def
type(obs_type) :: obs, prev_obs
integer :: i, num_copies, num_qc
integer :: days, seconds
@@ -82,13 +72,13 @@
integer :: startdate1, startdate2
integer :: obs_num, calender_type, iskip
integer :: obs_unit
-integer :: obs_kind, obs_kind_gen, which_vert, obstype
+integer :: obs_kind, which_vert, obstype
real (r8) :: lon, lat, vloc, obs_value
real (r8) :: aqc, var2, lonc
type(time_type) :: time, pre_time
-character(len = 8 ) :: obsdate
+character(len = 32) :: obs_kind_name
character(len = 80) :: label
character(len = 129) :: copy_meta_data, qc_meta_data
@@ -129,8 +119,6 @@
print*, 'input file opened= ', trim(obsfile)
rewind (obs_unit)
-!print*, 'ncep obsdates = ', obsdate
-
obs_num = 0
iskip = 0
@@ -140,8 +128,15 @@
obsloop: do
read(obs_unit,*,end=200) lon, lat, vloc, obs_value, which_vert, var2, aqc, &
- obstype, startdate1, startdate2
+ obs_kind_name, startdate1, startdate2
+ !print*,''
+ !print*,' Observation ', obs_num+1
+ !print*,' lon lat vloc obs_value ',lon, lat, vloc, obs_value
+ !print*,' which_vert var2 aqc ',which_vert, var2, aqc
+ !print*,' obs_kind_name ',obs_kind_name
+ !print*,' date1 date2 ',startdate1, startdate2
+
! Calculate the DART time from the observation time
yy = startdate1/10000
mn = mod(startdate1/100,100)
@@ -169,25 +164,13 @@
cycle obsloop
endif
-! assign each observation the correct observation type
- if(obstype == 1) then
- obs_kind_gen = KIND_TEMPERATURE
- obs_kind = TEMPERATURE
- elseif(obstype == 2) then
- obs_kind_gen = KIND_SALINITY
- obs_kind = SALINITY
- elseif(obstype == 3) then
- obs_kind_gen = KIND_U_WIND_COMPONENT
- obs_kind = U_CURRENT_COMPONENT
- elseif(obstype == 4) then
- obs_kind_gen = KIND_V_WIND_COMPONENT
- obs_kind = V_CURRENT_COMPONENT
- elseif(obstype == 5) then
- obs_kind_gen = KIND_SEA_SURFACE_HEIGHT
- obs_kind = SEA_SURFACE_HEIGHT
- else
- print*, 'unknown observation type ... skipping ...'
+ ! assign each observation the correct observation type
+ obstype = get_obs_kind_index(obs_kind_name)
+ if(obstype < 1) then
+ print*, 'unknown observation type [',trim(obs_kind_name),'] ... skipping ...'
cycle obsloop
+ else
+ print*,trim(obs_kind_name),' is ',obstype
endif
obs_num = obs_num + 1
@@ -212,7 +195,7 @@
!------------------------------------------------------------------------------
call real_obs(num_copies, num_qc, obs, lon, lat, vloc, obs_value, &
- var2, aqc, obs_kind, which_vert, seconds, days)
+ var2, aqc, obstype, which_vert, seconds, days)
if(obs_num == 1) then ! for the first observation
@@ -244,9 +227,22 @@
close(obs_unit)
-print*, 'date ', obsdate, ' obs used = ', obs_num, ' obs skipped = ', iskip
-!print*, 'obs_num= ',obs_num,' skipped= ',obsdate,iskip
+! Print a little summary
+print*, 'obs used = ', obs_num, ' obs skipped = ', iskip
+if ( get_first_obs(real_obs_sequence, obs) ) then
+ call get_obs_def(obs, obs_def)
+ pre_time = get_obs_def_time(obs_def)
+ call print_time(pre_time,' first time in sequence is ')
+ call print_date(pre_time,' first date in sequence is ')
+endif
+if( get_last_obs(real_obs_sequence, obs)) then
+ call get_obs_def(obs, obs_def)
+ time = get_obs_def_time(obs_def)
+ call print_time(time,' last time in sequence is ')
+ call print_date(time,' last date in sequence is ')
+endif
+
end function real_obs_sequence
Modified: DART/trunk/models/MITgcm_ocean/work/input.nml
===================================================================
--- DART/trunk/models/MITgcm_ocean/work/input.nml 2008-09-05 22:44:29 UTC (rev 3601)
+++ DART/trunk/models/MITgcm_ocean/work/input.nml 2008-09-05 22:55:31 UTC (rev 3602)
@@ -97,7 +97,33 @@
'TEMPERATURE',
'U_CURRENT_COMPONENT',
'V_CURRENT_COMPONENT',
- 'SEA_SURFACE_HEIGHT' /
+ 'SEA_SURFACE_HEIGHT',
+ 'ARGO_U_CURRENT_COMPONENT',
+ 'ARGO_V_CURRENT_COMPONENT',
+ 'ARGO_SALINITY',
+ 'ARGO_TEMPERATURE',
+ 'ADCP_U_CURRENT_COMPONENT',
+ 'ADCP_V_CURRENT_COMPONENT',
+ 'ADCP_SALINITY',
+ 'ADCP_TEMPERATURE',
+ 'FLOAT_SALINITY',
+ 'FLOAT_TEMPERATURE',
+ 'DRIFTER_U_CURRENT_COMPONENT',
+ 'DRIFTER_V_CURRENT_COMPONENT',
+ 'DRIFTER_SALINITY',
+ 'DRIFTER_TEMPERATURE',
+ 'GLIDER_U_CURRENT_COMPONENT',
+ 'GLIDER_V_CURRENT_COMPONENT',
+ 'GLIDER_SALINITY',
+ 'GLIDER_TEMPERATURE',
+ 'MOORING_U_CURRENT_COMPONENT',
+ 'MOORING_V_CURRENT_COMPONENT',
+ 'MOORING_SALINITY',
+ 'MOORING_TEMPERATURE',
+ 'SATELLITE_MICROWAVE_SST',
+ 'SATELLITE_INFRARED_SST',
+ 'SATELLITE_SSH',
+ 'SATELLITE_SSS' /
&preprocess_nml
input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90',
@@ -197,12 +223,8 @@
day = 1,
tot_days = 14,
max_num = 800000,
- fname = '../observations/gliders_t_pseudo.txt',
- ADCP = .true.,
- DRIFTERS = .true.,
- GLIDERS = .true.,
- TMI = .true.,
- SSH = .true.,
+ fname = '../observations/drifters_v_pseudo.txt',
+ output_name = '../observations/drifters_v_pseudo.obs_seq.out',
lon1 = 0.0,
lon2 = 360.0,
lat1 = 0.0,
More information about the Dart-dev
mailing list