diff --git a/adaptive_inflate/adaptive_inflate_mod.f90 b/adaptive_inflate/adaptive_inflate_mod.f90 index ae86d729bf..49c857e7f5 100644 --- a/adaptive_inflate/adaptive_inflate_mod.f90 +++ b/adaptive_inflate/adaptive_inflate_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module adaptive_inflate_mod @@ -29,10 +27,9 @@ module adaptive_inflate_mod ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'adapative_inflate_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Manages both observation space and state space inflation ! Handles initial values and restarts, diagnostic output, and computations @@ -1015,8 +1012,3 @@ end subroutine solve_quadratic end module adaptive_inflate_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/adaptive_inflate/fill_inflation_restart.f90 b/adaptive_inflate/fill_inflation_restart.f90 index d24ca1db5f..46c64ea644 100644 --- a/adaptive_inflate/fill_inflation_restart.f90 +++ b/adaptive_inflate/fill_inflation_restart.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program fill_inflation_restart @@ -26,10 +24,9 @@ program fill_inflation_restart implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'fill_inflation_restart.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Read 2 floating point values from the console - the initial inflation value ! and the inflation standard deviation. Will write an output file named @@ -90,8 +87,3 @@ program fill_inflation_restart end program fill_inflation_restart -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/assim_model/assim_model_mod.f90 b/assim_model/assim_model_mod.f90 index 7b1c6d01cb..31752cc99f 100644 --- a/assim_model/assim_model_mod.f90 +++ b/assim_model/assim_model_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module assim_model_mod @@ -46,10 +44,9 @@ module assim_model_mod get_close_obs_init, get_close_obs, ens_mean_for_model ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'assim_model_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Type to keep model state and time together @@ -1576,8 +1573,3 @@ end function nc_write_calendar_atts ! end module assim_model_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/assim_tools/assim_tools_mod.f90 b/assim_tools/assim_tools_mod.f90 index 3c60775451..54b7488f96 100644 --- a/assim_tools/assim_tools_mod.f90 +++ b/assim_tools/assim_tools_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module assim_tools_mod @@ -82,10 +80,9 @@ module assim_tools_mod real(r8) :: exp_true_correl(200), alpha(200) ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'assim_tools_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !============================================================================ @@ -428,6 +425,10 @@ subroutine filter_assim(ens_handle, obs_ens_handle, obs_seq, keys, & if (my_obs_type(i) > 0) then my_obs_kind(i) = get_obs_kind_var_type(my_obs_type(i)) else +!!$ if(my_obs_type(i) .eq. 0) print *, 'Get_Obs_Locations: i = ', i, & +!!$ ', my_obs_type(i) = ', my_obs_type(i), ', my_obs_kind(i) = ', my_obs_kind(i) +!!$ if(my_obs_kind(i) .eq. 0) print *, 'Get_Obs_Locations: i = ', i, & +!!$ ', my_obs_type(i) = ', my_obs_type(i), ', my_obs_kind(i) = ', my_obs_kind(i) call get_state_meta_data(-1 * my_obs_type(i), dummyloc, my_obs_kind(i)) ! identity obs endif ! Need the time for regression diagnostics potentially; get from first observation @@ -440,6 +441,10 @@ subroutine filter_assim(ens_handle, obs_ens_handle, obs_seq, keys, & ! Get the location and kind of all my state variables do i = 1, ens_handle%my_num_vars +!!$ if(my_state_indx(i) .eq. 0) print *, 'Get location and kind: i = ', i, & +!!$ ', my_state_indx(i) = ', my_state_indx(i), ', my_state_kind(i) = ', my_state_kind(i) +!!$ if(my_state_kind(i) .eq. 0) print *, 'Get location and kind: i = ', i, & +!!$ ', my_state_indx(i) = ', my_state_indx(i), ', my_state_kind(i) = ', my_state_kind(i) call get_state_meta_data(my_state_indx(i), my_state_loc(i), my_state_kind(i)) end do @@ -530,6 +535,10 @@ subroutine filter_assim(ens_handle, obs_ens_handle, obs_seq, keys, & if (base_obs_type > 0) then base_obs_kind = get_obs_kind_var_type(base_obs_type) else +!!$ if(base_obs_type .eq. 0) print *, 'SEQUENTIAL_OBS: i = ', i, & +!!$ ', base_obs_type = ', base_obs_type, ', base_obs_kind = ', base_obs_kind +!!$ if(base_obs_kind .eq. 0) print *, 'SEQUENTIAL_OBS: i = ', i, & +!!$ ', base_obs_type = ', base_obs_type, ', base_obs_kind = ', base_obs_kind call get_state_meta_data(-1 * base_obs_type, dummyloc, base_obs_kind) ! identity obs endif ! Get the value of the observation @@ -2589,8 +2598,3 @@ end function count_close end module assim_tools_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/common/types_mod.f90 b/common/types_mod.f90 index d2d9714760..a262fac6ba 100644 --- a/common/types_mod.f90 +++ b/common/types_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ MODULE types_mod @@ -20,10 +18,9 @@ MODULE types_mod public :: obstypelength ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'types_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' SAVE @@ -95,8 +92,3 @@ MODULE types_mod END MODULE types_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/cov_cutoff/cov_cutoff_mod.f90 b/cov_cutoff/cov_cutoff_mod.f90 index ea1172c0db..a766fa15d0 100644 --- a/cov_cutoff/cov_cutoff_mod.f90 +++ b/cov_cutoff/cov_cutoff_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module cov_cutoff_mod @@ -19,10 +17,9 @@ module cov_cutoff_mod public :: comp_cov_factor ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'cov_cutoff_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !============================================================================ @@ -183,8 +180,3 @@ end function comp_cov_factor end module cov_cutoff_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/diagnostics/threed_sphere/obs_diag.f90 b/diagnostics/threed_sphere/obs_diag.f90 index aaf8fa2686..9069af13d1 100644 --- a/diagnostics/threed_sphere/obs_diag.f90 +++ b/diagnostics/threed_sphere/obs_diag.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program obs_diag @@ -61,10 +59,9 @@ program obs_diag implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'threed_sphere/obs_diag.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !--------------------------------------------------------------------- ! Some basic parameters @@ -4809,8 +4806,3 @@ end function IRemoveDuplicates end program obs_diag -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/ensemble_manager/ensemble_manager_mod.f90 b/ensemble_manager/ensemble_manager_mod.f90 index d894dd4877..bebc4fd397 100644 --- a/ensemble_manager/ensemble_manager_mod.f90 +++ b/ensemble_manager/ensemble_manager_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module ensemble_manager_mod @@ -32,10 +30,9 @@ module ensemble_manager_mod private ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'ensemble_manager_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !PAR other storage option control can be implemented here. In particular, want to find !PAR some way, either allocating or multiple addressing, to use same chunk of storage @@ -1858,9 +1855,3 @@ end function map_task_to_pe end module ensemble_manager_mod - -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/filter/filter.f90 b/filter/filter.f90 index 8edc82bcb6..91924fd4ed 100644 --- a/filter/filter.f90 +++ b/filter/filter.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program filter @@ -57,10 +55,9 @@ program filter implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'filter.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Some convenient global storage items character(len=129) :: msgstring @@ -1960,8 +1957,3 @@ end function failed_outlier end program filter -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/filter/wakeup_filter.f90 b/filter/wakeup_filter.f90 index 5e876b0730..948fb1d56a 100644 --- a/filter/wakeup_filter.f90 +++ b/filter/wakeup_filter.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program wakeup_filter @@ -24,8 +22,3 @@ program wakeup_filter end program wakeup_filter -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/location/location_test.f90 b/location/location_test.f90 index c341957dc4..a58324fd65 100644 --- a/location/location_test.f90 +++ b/location/location_test.f90 @@ -20,7 +20,7 @@ program location_test character(len=32 ), parameter :: revision = "$Revision$" character(len=128), parameter :: revdate = "$Date$" -type(location_type) :: loc0(6), loc1, loc2, loc3, loc4, locA(7), locB(5) +type(location_type) :: loc0(6), loc1, loc2, loc3, loc4, locA(8), locB(8) integer :: iunit, iunit1, iunit2, i real(r8) :: loc2_val, lon, lat character(len=102) :: testbuf @@ -43,10 +43,10 @@ program location_test end do print *, '' -print *, 'reading in 7 locations for file read/write tests:' +print *, 'reading in 8 locations for file read/write tests:' -! read in 7 different locs for the tests below -do i = 1, 7 +! read in 8 different locs for the tests below +do i = 1, 8 call interactive_location(locA(i)) enddo @@ -68,7 +68,7 @@ program location_test call write_location(iunit, loc1) call write_location(iunit, loc2) -do i = 1, 5 +do i = 1, 8 call write_location(iunit, locA(i)) enddo @@ -98,7 +98,7 @@ program location_test call write_location(iunit, loc1, 'unformatted') call write_location(iunit, loc2, 'unformatted') -do i = 1, 5 +do i = 1, 8 call write_location(iunit, locA(i), 'unformatted') enddo @@ -125,28 +125,28 @@ program location_test print *, '' print *, 'raw locations: ' -do i = 1, 5 +do i = 1, 8 print *, get_location(locA(i)) enddo print *, '' print *, 'locations formatted to a char buffer:' -do i = 1, 5 +do i = 1, 8 call write_location(0, locA(i), 'formatted', testbuf) print *, 'string length: ', len_trim(testbuf) enddo -do i = 1, 5 +do i = 1, 8 call write_location(0, locA(i), 'formatted', testbuf) print *, trim(testbuf) enddo print *, '' print *, 'ascii readback: ' -do i = 1, 5 +do i = 1, 8 locB(i) = set_location_missing() locB(i) = read_location(iunit1, 'formatted') print *, get_location(locB(i)) enddo -do i = 1, 5 +do i = 1, 8 call write_location(0, locB(i), 'formatted', testbuf) print *, trim(testbuf) enddo @@ -156,12 +156,12 @@ program location_test print *, '' print *, 'binary readback: ' -do i = 1, 5 +do i = 1, 8 locB(i) = set_location_missing() locB(i) = read_location(iunit2, 'unformatted') print *, get_location(locB(i)) enddo -do i = 1, 5 +do i = 1, 8 call write_location(0, locB(i), 'formatted', testbuf) print *, trim(testbuf) enddo diff --git a/location/threed_sphere/location_mod.f90 b/location/threed_sphere/location_mod.f90 index 29f50d5bb1..ff44cd4b2b 100644 --- a/location/threed_sphere/location_mod.f90 +++ b/location/threed_sphere/location_mod.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ !> Implements location interfaces for a three dimensional spherical shell !> with a choice of vertical coordinates. @@ -48,10 +46,9 @@ module location_mod VERTISHEIGHT, VERTISSCALEHEIGHT, print_get_close_type, horiz_dist_only ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'threed_sphere/location_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! The possible numeric values for the location_type%which_vert component. ! The numeric values are PRIVATE to this module. The parameter names are PUBLIC. @@ -816,17 +813,17 @@ subroutine write_location(locfile, loc, fform, charstring) ! into the return string. select case (loc%which_vert) case (VERTISUNDEF) - write(charstring, '(A,A)') trim(string1), ' Undefined' + write(charstring, '(A,16x,A)') trim(string1), ' Undefined' case (VERTISSURFACE) - write(charstring, '(A,F13.5,A)') trim(string1), loc%vloc, ' surface (m)' + write(charstring, '(A,1x,F15.7,A)') trim(string1), loc%vloc, ' surface (m)' case (VERTISLEVEL) - write(charstring, '(A,F6.0,A)') trim(string1), loc%vloc, ' level' + write(charstring, '(A,1x,F6.0,A)') trim(string1), loc%vloc, ' level' case (VERTISPRESSURE) - write(charstring, '(A,F13.7,A)') trim(string1), loc%vloc / 100.0_r8, ' hPa' + write(charstring, '(A,1x,F15.7,A)') trim(string1), loc%vloc / 100.0_r8, ' hPa' case (VERTISHEIGHT) - write(charstring, '(A,F13.7,A)') trim(string1), loc%vloc / 1000.0_r8, ' km' + write(charstring, '(A,1x,F15.7,A)') trim(string1), loc%vloc / 1000.0_r8, ' km' case (VERTISSCALEHEIGHT) - write(charstring, '(A,F13.7,A)') trim(string1), loc%vloc, ' scale ht' + write(charstring, '(A,1x,F15.7,A)') trim(string1), loc%vloc, ' scale ht' case default write(msgstring, *) 'unrecognized key for vertical type: ', loc%which_vert call error_handler(E_ERR, 'write_location', msgstring, source, revision, revdate) @@ -2521,8 +2518,3 @@ end subroutine print_get_close_type end module location_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/location/threed_sphere/test/test.in b/location/threed_sphere/test/test.in index cbfe5e9a0a..388f64b237 100644 --- a/location/threed_sphere/test/test.in +++ b/location/threed_sphere/test/test.in @@ -25,7 +25,7 @@ -90 90 3 -1000 +404003280 10 20 -2 @@ -62,5 +62,8 @@ 1005 145 -30 - +1 +42 +200.0 +40.0 diff --git a/mkmf/mkmf.template b/mkmf/mkmf.template index 5e41aeaf82..141788799b 100755 --- a/mkmf/mkmf.template +++ b/mkmf/mkmf.template @@ -1,4 +1,4 @@ -# Template for GNU gfortran on Linux or Mac OSX +# Template for Intel Fortran Compiler on Linux clusters and workstations. # # DART software - Copyright 2004 - 2013 UCAR. This open source software is # provided by UCAR, "as is", without charge, subject to all terms of use at @@ -9,57 +9,97 @@ # typical use with mkmf # mkmf -t mkmf.template.xxxx ... # -# Suggested (perhaps required) flags: -# -ffree-line-length-none handles "long" lines - i.e. longer than 72 chars -# -# Suggested debugging flags: -# -g add debugging information to executable -# -Wuninitialized catch uninitialized variables -# -Wunused issue warning for unused variables - keeps code clean -# -fbacktrace runtime errors try to print out a stack backtrace -# -fbounds-check add runtime-checking for out-of-range array indices -# -ffpe-trap=invalid,zero,overflow -# stop on floating point errors -# -# earlier versions of this mkmf file listed 'precision' as one of the options on -# the fpe-trap line. this is not recommended anymore as some of the gfortran internal -# routines will trap, as well as some perfectly valid DART computations. -# -# Generally not needed but possibly useful for non-DART code: -# -# -ffree-form forces input file to be read as free format regardless -# of what file extension it has. -# -# -fdefault-real-8 force all real variables to be real*8. not needed for DART code -# since all real variables in DART are declared with a size. -# -# NOTE: Some previous versions of the gfortran compiler (including 4.1.2) -# changed the record marker size to 8 bytes, which made binary files written -# with the 'unformatted' option unreadable by programs compiled with other -# compilers. Later versions of the compiler changed the default back to 4 bytes. -# If you have a version that defaults to 8 byte record markers, use this -# compile time flag: -# -frecord-marker=4 -# If you have files written by older versions of the gfortran compiler that -# cannot be read now, try this compile time flag: -# -frecord-marker=8 -# -# Convert big-endian or little-endian binary files at runtime: -# -# setenv GFORTRAN_CONVERT_UNIT 'big_endian' -# Treats ALL units as big_endian -# -# setenv GFORTRAN_CONVERT_UNIT 'big_endian;native:10-20' -# Treats units 10-20 as big_endian but the rest are 'native' -# -# for more information on unit conversions: -# http://gcc.gnu.org/onlinedocs/gfortran/GFORTRAN_005fCONVERT_005fUNIT.html#GFORTRAN_005fCONVERT_005fUNIT -# +# FFLAGS useful for DEBUGGING. NOTE: The intel compiler can provide a lot more +# information if you LEAVE the object and module files intact. +# Do not remove the *.o and *.mod files when debugging code. +# +# -g include debugging information. these are all synonyms. +# -debug full +# -debug all +# -O0 setting -g will make this the default (no optimization). +# it is possible to set -g and then explicitly set -O2 if +# the behavior being debugged depends on optimization changes. +# -ftrapuv traps if a local variable is used before being set +# -C enables all runtime checks. -C and -check all are synonyms. +# -check all +# -check enables/disables more specific runtime checks. +# keywords: [arg_temp_created,bounds,overflow,format,pointers,uninit] +# -warn the level of warning messages issued. +# keywords: [alignments, argument_checking, declarations, +# errors, fileopt, general, ignore_loc, +# stderrors, truncated_source, uncalled, +# uninitialized, unused, usage, all] +# -fp-stack-check catches conditions where the FP stack is not correct. +# Typically this is when a real function is called as if it were a +# subroutine, OR a subroutine is called as if it were a function (return +# values left of FP stack OR too much data is taken off the FP stack) +# -vec-reportN controls how much diagnostic output is printed about +# loops vectorized by the compiler. N = 0 is silent, +# N can have values up to 5. +# -traceback tells the compiler to generate extra information in the +# object file to provide source file traceback information +# when a severe error occurs at run time +# +# FFLAGS useful for bitwise reproducibility and accuracy control +# (these will slow down performance to various degrees) +# -fp-model precise control how floating point roundoff is done so it is +# reproducible from run to run. in simple tests this +# flag alone was enough to create bitwise reproducible +# code but slowed execution significantly. +# -ftz 'flush to zero' underflows result in zero. set by default if +# any -O other than -O0 set, or if -fpe0 or -fpe1 set. +# -fpeN controls floating point exception handling. -fpe0 rounds underflow +# to zero and traps on any other exception type. +# -pc80 set internal FPU precision to 64 bit significand +# (default is -pc64 with 53 internal bits) +# +# FFLAGS useful for production +# -O2 default. optimize without too much unrepeatable numerical games +# -O3 more aggressive optimizations. check numerical differences +# before using this indiscriminately. +# -O1 if you get compile-time errors about out of memory or unable to +# complete compilation because of complexity, try lowering the +# optimization level on the offending source files. +# -ipo enable optimizations between routines in separate source files +# -heap-arrays 10 allocate large arrays from the heap instead of putting them +# on the stack. the number is the limit in KB for when arrays +# move from the stack to the heap. this can help if you get stack +# overflow errors and cannot increase the stack size more. +# allocating from the stack is faster, but it's usually a smaller +# size than the heap. +# -x, -m, -ax, -mcode, -march all these flags tell the compiler to generate +# processor-specific or vector instructions. either 'man ifort' or +# ifort --help to see what the current list of options are and +# which have priority over the others. +# (for those running on yellowstone, -axavx will enable the advanced +# vector instructions available on the sandy bridge processors.) +# +# FFLAGS possibly useful, not normally used by DART +# -fpp run Fortran preprocessor on source files prior to compilation +# -free interpret source as free-format, regardless of file extension +# -r8 specify default real size. note that for DART we use explicit +# types on all our real values so this will not change anything +# inside DART. see DART/common/types_mod.f90 if you must run +# with single precision reals. +# -convert big_endian useful if you're on the wrong architecture. +# however this controls both reading and writing so you can't +# use it as a conversion mechanism unless you write files out +# in ascii format. applies to all unformatted fortran i/o. +# -assume byterecl ... more 'industry-standard' direct-access behavior +# controls what units the RECL (record length) specifier returns. +# +# Runtime environment variables that influence the compiler behavior: +# +# Make output lines for fortran write statements longer without wrapping: +# setenv FORT_FMT_RECL 512 (or any length) +# +# +# IF YOU HAVE MORE CURRENT COMPILER INFORMATION, PLEASE SHARE IT WITH US. MPIFC = mpif90 MPILD = mpif90 -FC = gfortran -LD = gfortran +FC = ifort +LD = ifort # DISCUSSION ABOUT NETCDF. DART works with both V3 and V4 flavors of netCDF. # Some V4 installations also require the HDF5 libraries. Some don't. @@ -81,14 +121,29 @@ LD = gfortran # are found for the netcdf files that match this compiler. # # NETCDF = /opt/local +NETCDF = /apps/netcdf/4.7.3 INCS = -I$(NETCDF)/include -LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -FFLAGS = -O2 -ffree-line-length-none $(INCS) +#LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf +LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -lcurl +#FFLAGS = -O $(INCS) +FFLAGS = -g -fpe0 -traceback $(INCS) LDFLAGS = $(FFLAGS) $(LIBS) -# FFLAGS = -g -Wuninitialized -Wunused -ffree-line-length-none -fbounds-check \ -# -fbacktrace -ffpe-trap=invalid,zero,overflow $(INCS) +# for development or debugging, use this instead: +#FFLAGS = -g -C -check noarg_temp_created -fpe0 \ +# -fp-model precise -ftrapuv -traceback \ +# $(INCS) + +# for speed on yellowstone (verify against a run with with -O and -fp-model precise +# that the numerical differences aren't too large to be acceptable): +# FFLAGS = -O3 -axavx -ipo -vec-report0 $(INCS) +# +# Some optimized (BLAS, LAPACK) libraries may be available with: +# LIBS = -L$(NETCDF)/lib -lnetcdff -lnetcdf -lmkl -lmkl_lapack -lguide -lpthread +# +# If you get this error: libimf.so: warning: warning: feupdateenv is not implemented +# try adding: -limf -lm to your LIBS line. # # $URL$ diff --git a/models/cam/shell_scripts/CESM1_2_1_setup_advanced b/models/cam/shell_scripts/CESM1_2_1_setup_advanced index d310fc9e30..e6efd0ba22 100755 --- a/models/cam/shell_scripts/CESM1_2_1_setup_advanced +++ b/models/cam/shell_scripts/CESM1_2_1_setup_advanced @@ -1,10 +1,8 @@ #!/bin/csh -f # -# DART software - Copyright 2004 - 2013 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download -# -# DART $Id$ #******************************************************************************* # @@ -1208,8 +1206,3 @@ cat ${caseroot}/DART_instructions.txt exit 0 -# -# $URL$ -# $Revision$ -# $Date$ - diff --git a/models/cam/shell_scripts/CESM1_2_1_setup_hybrid b/models/cam/shell_scripts/CESM1_2_1_setup_hybrid index a27c524280..8219ba79c6 100755 --- a/models/cam/shell_scripts/CESM1_2_1_setup_hybrid +++ b/models/cam/shell_scripts/CESM1_2_1_setup_hybrid @@ -1,10 +1,8 @@ #!/bin/csh -f # -# DART software - Copyright 2004 - 2013 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download -# -# DART $Id$ #******************************************************************************* # @@ -1030,8 +1028,3 @@ cat ${caseroot}/DART_instructions.txt exit 0 -# -# $URL$ -# $Revision$ -# $Date$ - diff --git a/models/cam/shell_scripts/CESM1_2_1_setup_pmo b/models/cam/shell_scripts/CESM1_2_1_setup_pmo index 44bc3d75c3..2d50dc330d 100755 --- a/models/cam/shell_scripts/CESM1_2_1_setup_pmo +++ b/models/cam/shell_scripts/CESM1_2_1_setup_pmo @@ -1,10 +1,8 @@ #!/bin/csh -f # -# DART software - Copyright 2004 - 2013 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download -# -# DART $Id$ #******************************************************************************* # @@ -1035,8 +1033,3 @@ cat ${caseroot}/DART_instructions.txt exit 0 -# -# $URL$ -# $Revision$ -# $Date$ - diff --git a/models/cam/shell_scripts/CESM1_2_1_setup_pmo_advanced b/models/cam/shell_scripts/CESM1_2_1_setup_pmo_advanced index ab5cab485e..a761d7cbc6 100755 --- a/models/cam/shell_scripts/CESM1_2_1_setup_pmo_advanced +++ b/models/cam/shell_scripts/CESM1_2_1_setup_pmo_advanced @@ -1,10 +1,8 @@ #!/bin/csh -f # -# DART software - Copyright 2004 - 2013 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download -# -# DART $Id$ #******************************************************************************* # @@ -1218,8 +1216,3 @@ cat ${caseroot}/DART_instructions.txt exit 0 -# -# $URL$ -# $Revision$ -# $Date$ - diff --git a/models/gitm/model_mod.f90 b/models/gitm/model_mod.f90 index 959f43820f..a7d759476b 100644 --- a/models/gitm/model_mod.f90 +++ b/models/gitm/model_mod.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module model_mod @@ -38,7 +36,7 @@ module model_mod use obs_kind_mod, only : paramname_length, & get_raw_obs_kind_index, & get_raw_obs_kind_name, & - KIND_GEOPOTENTIAL_HEIGHT + KIND_GEOMETRIC_HEIGHT use mpi_utilities_mod, only: my_task_id @@ -82,10 +80,9 @@ module model_mod get_state_time ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'gitm/model_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' character(len=256) :: string1, string2 logical, save :: module_initialized = .false. @@ -396,7 +393,7 @@ subroutine model_interpolate(x, location, obs_type, interp_val, istatus) ! return values have already been set, just give it a more specific error ! code and return here. -if (obs_type == KIND_GEOPOTENTIAL_HEIGHT ) then +if (obs_type == KIND_GEOMETRIC_HEIGHT) then ! ok to continue. offsets unused in this case, but ! set them to something > 0 to indicate its ok. base_offset = 1 @@ -463,7 +460,7 @@ subroutine model_interpolate(x, location, obs_type, interp_val, istatus) endif ! if we're asking about height, we have the alt arrays directly. -if (obs_type == KIND_GEOPOTENTIAL_HEIGHT) then +if (obs_type == KIND_GEOMETRIC_HEIGHT) then ! Interpolate to the given altitude - lat/lon doesn't matter here. interp_val = (1 - alt_fract) * ALT(balt(1)) + alt_fract * ALT(balt(2)) @@ -3438,8 +3435,3 @@ end subroutine sortindexlist end module model_mod !=================================================================== -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/models/tiegcm/dart_to_model.f90 b/models/tiegcm/dart_to_model.f90 index c72f2aa212..586a7b5df6 100644 --- a/models/tiegcm/dart_to_model.f90 +++ b/models/tiegcm/dart_to_model.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ !---------------------------------------------------------------------- @@ -41,10 +39,9 @@ program dart_to_model implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'tiegcm/dart_to_model.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !----------------------------------------------------------------------- ! namelist parameters with default values. @@ -221,8 +218,3 @@ end subroutine write_tiegcm_time_control end program dart_to_model -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/models/tiegcm/matlab/check_me.m b/models/tiegcm/matlab/check_me.m new file mode 100644 index 0000000000..d56349cb11 --- /dev/null +++ b/models/tiegcm/matlab/check_me.m @@ -0,0 +1,52 @@ +%% +% + +file2 = '/glade/scratch/thoar/tiegcm_test/test2/Posterior_Diag.nc'; +file4 = '/glade/scratch/chihting/job_test/test4/Posterior_Diag.nc'; + +vars = {'NE','TN','O1','O2','UN','VN','OP'}; + +for ivar = 1:length(vars) + + v2 = nc_varget(file2, vars{ivar}); + v4 = nc_varget(file4, vars{ivar}); + + copy = 1; % Just checking the ensemble mean + + for iz = 1:size(v2,2) + org = squeeze(v2(copy,iz,:,:)); + new = squeeze(v4(copy,iz,:,:)); + change = new-org; + + dmin = min([org(:); new(:)]); + dmax = max([org(:); new(:)]); + + subplot(3,1,1); + imagesc(org, [dmin dmax]); set(gca,'YDir','normal') + title(sprintf('Original %s at level %d',vars{ivar}, iz)) + colorbar + + subplot(3,1,2); + imagesc(new); set(gca,'YDir','normal') + title(sprintf('Proposed %s at level %d',vars{ivar}, iz)) + colorbar + + subplot(3,1,3); + imagesc(change); set(gca,'YDir','normal') + title(sprintf('Difference (new-old) at level %d',iz)) + colorbar + + % Find the relative change in orders of magnitude and print if any are 'big' + + maxdiff = max(abs(change(:))); + indx = find(abs(change(:)) == maxdiff); + relchange = log10(org(indx)) - log10(maxdiff); + + if ( relchange < 5 ) + fprintf('%s level %d has some non-neglible changes ... %f\n',vars{ivar}, iz, relchange) + end + + fprintf('Showing %s level %d of %d ... pausing\n',vars{ivar}, iz, size(v2,2)) + pause(1.0) % in seconds. + end +end diff --git a/models/tiegcm/model_mod.alex.f90 b/models/tiegcm/model_mod.alex.f90 new file mode 100644 index 0000000000..9639df107e --- /dev/null +++ b/models/tiegcm/model_mod.alex.f90 @@ -0,0 +1,2691 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! $Id$ + +module model_mod + + +!------------------------------------------------------------------ +! +! Interface for HAO-TIEGCM +! +!------------------------------------------------------------------ +! DART Modules +use types_mod, only : r8, digits12, missing_r8, i4, PI, & + earth_radius, gravity +use time_manager_mod, only : time_type, set_calendar_type, set_time_missing, & + set_time, get_time, print_time, & + set_date, get_date, print_date, & + operator(*), operator(+), operator(-), & + operator(>), operator(<), operator(/), & + operator(/=), operator(<=) +use location_mod, only : location_type, get_close_maxdist_init, & + get_close_obs_init, loc_get_close_obs => get_close_obs,& + set_location, get_location, query_location, & + get_dist, vert_is_height, horiz_dist_only, & + get_close_type, vert_is_undef, VERTISUNDEF, & + VERTISPRESSURE, VERTISHEIGHT, vert_is_pressure +use utilities_mod, only : file_exist, open_file, close_file, & + error_handler, E_ERR, E_MSG, E_WARN, nmlfileunit, & + do_output, find_namelist_in_file, check_namelist_read, & + do_nml_file, do_nml_term, nc_check, & + register_module +use obs_kind_mod, only : KIND_U_WIND_COMPONENT, &! just for definition + KIND_V_WIND_COMPONENT, &! just for definition + KIND_TEMPERATURE, &! neutral density obs + KIND_PRESSURE, &! neutral density obs + KIND_ELECTRON_DENSITY, &! Ne obs + KIND_ATOMIC_OXYGEN_MIXING_RATIO, &! neutral density obs + KIND_MOLEC_OXYGEN_MIXING_RATIO, &! neutral density obs + KIND_1D_PARAMETER, &! just for definition + KIND_GEOPOTENTIAL_HEIGHT, &! + KIND_VERTICAL_TEC ! TEC obs +use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian +use mpi_utilities_mod,only : my_task_id +use typesizes +use netcdf + +implicit none +private + +public :: get_model_size, & + adv_1step, & + get_state_meta_data, & + model_interpolate, & + get_model_time_step, & + end_model, & + static_init_model, & + init_time, & + init_conditions, & + nc_write_model_atts, & + nc_write_model_vars, & + pert_model_state, & + get_close_maxdist_init, & + get_close_obs_init, & + get_close_obs, & + ens_mean_for_model +!TIEGCM specific routines +public :: model_type, & + init_model_instance, & + end_model_instance, & + prog_var_to_vector, & + vector_to_prog_var, & + read_TIEGCM_restart, & + update_TIEGCM_restart, & + read_TIEGCM_definition, & + read_TIEGCM_secondary, & + read_TIEGCM_namelist + +! version controlled file description for error handling, do not edit +character(len=256), parameter :: source = & + "$URL$", & +character(len=32 ), parameter :: revision = "$Revision$" +character(len=128), parameter :: revdate = "$Date$" + +!------------------------------------------------------------------ +! define model parameters + +integer :: nilev, nlev, nlon, nlat +real(r8),dimension(:), allocatable :: lons, lats, levs, ilevs, plevs, pilevs +real(r8) :: TIEGCM_missing_value !! global attribute +real(r8) :: TIEGCM_reference_pressure +integer :: time_step_seconds +integer :: time_step_days +type(time_type) :: time_step + + ! IMPORTANT: Change output file names in + ! tiegcm.nml to match with the names below + ! i.e. OUTPUT='tiegcm_restart_p.nc' + ! SECOUT='tiegcm_s.nc' +character (len=19) :: restart_file = 'tiegcm_restart_p.nc' +character (len=11) :: secondary_file = 'tiegcm_s.nc' +character (len=10) :: namelist_file = 'tiegcm.nml' + + ! 3d TIEGCM variables are packed into + ! DART state vector in the following order +integer, parameter :: TYPE_local_ZG = 0 +integer, parameter :: TYPE_local_TN = 1 +integer, parameter :: TYPE_local_TN_NM = 2 +integer, parameter :: TYPE_local_O1 = 3 +integer, parameter :: TYPE_local_O1_NM = 4 +integer, parameter :: TYPE_local_O2 = 5 +integer, parameter :: TYPE_local_O2_NM = 6 +integer, parameter :: TYPE_local_UN = 7 +integer, parameter :: TYPE_local_UN_NM = 8 +integer, parameter :: TYPE_local_VN = 9 +integer, parameter :: TYPE_local_VN_NM = 10 +integer, parameter :: TYPE_local_NE = 11 + + ! 2d TIEGCM variables are packed into + ! DART state vector in the following order +integer, parameter :: TYPE_local_2D_TEC = 0 + +type model_type + real(r8), pointer :: vars_3d(:,:,:,:) + real(r8), pointer :: vars_2d(:,:,:) + real(r8), pointer :: vars_1d(:) + type(time_type) :: valid_time +end type model_type + +logical :: only_neutral_density = .false. + ! .true. excludes UN VN NE (state_num_3d = 7) + ! .false. includes UN VN NE (state_num_3d = 12) +logical :: include_vTEC = .true. !only_neutral_density = .false. + ! .true. includes vTEC (state_num_2d = 1) + ! .false. excludes vTEC (state_num_2d = 0) +integer :: state_num_3d = 12 + ! -- interface levels -- + ! NE ZG + ! -- midpoint levels -- + ! O1 O1_NM O2 O2_NM + ! -- midpoint levels; top slot missing -- + ! TN TN_NM UN UN_NM VN VN_NM +integer :: state_num_2d = 1 + ! vTEC (computed in read_TIEGCM_restart + ! from NE, Ti, Te, Z) +integer :: state_num_1d = 0 +logical :: estimate_parameter = .false. + ! IMPORTANT: 1 D model parameters (e.g., F107) are read in from "tiegcm.nml" + ! When "estimate_parameter = .true.", "state_num_1d" should be greater than or + ! equal to 1 so that 1 D model parameters will be included in the state vector + ! (note "estimate_parameter" option is still under + ! development by Tomoko Matsuo as of June 24, 2011) + +integer :: model_size +real(r8), allocatable :: ens_mean(:) + + ! FOR NOW OBS LOCATIONS ARE EXPECTED GIVEN IN HEIGHT [m], + ! AND SO VERTICAL LOCALIZATION COORDINATE IS *always* HEIGHT + ! (note that gravity adjusted geopotential height (ZG) + ! read in from "tiegcm_s.nc") +!integer :: vert_localization_coord = VERTISHEIGHT + +logical :: output_state_vector = .false. + ! .true. results in a "state-vector" netCDF file + ! .false. results in a "prognostic-var" netCDF file +logical :: first_pert_call = .true. +type(random_seq_type) :: random_seq + +!------------------------------------------------------------------ + +character(len = 129) :: msgstring +logical, save :: module_initialized = .false. + +namelist /model_nml/ output_state_vector, state_num_3d, state_num_1d + + +contains + +!================================================================== + + +subroutine static_init_model() +!------------------------------------------------------------------ +! +! Called to do one time initialization of the model. As examples, +! might define information about the model size or model timestep. +! In models that require pre-computed static data, for instance +! spherical harmonic weights, these would also be computed here. +! Can be a NULL INTERFACE for the simplest models. + + integer :: i + integer :: iunit, io + +if (module_initialized) return ! only need to do this once + +! Print module information to log file and stdout. +call register_module(source, revision, revdate) + +! Since this routine calls other routines that could call this routine +! we'll say we've been initialized pretty dang early. +module_initialized = .true. + +!! Read the namelist entry for model_mod from input.nml +!call find_namelist_in_file("input.nml", "model_nml", iunit) +!read(iunit, nml = model_nml, iostat = io) +!call check_namelist_read(iunit, io, "model_nml") + +!if (do_nml_file()) write(nmlfileunit, nml=model_nml) +!if (do_nml_term()) write( * , nml=model_nml) + +! Reading in TIEGCM grid definition etc from TIEGCM restart file +call read_TIEGCM_definition(restart_file) + +! Reading in TIEGCM namelist input file (just for definition) +call read_TIEGCM_namelist(namelist_file) + +! Compute overall model size +model_size = nlon * nlat * nlev * state_num_3d & + + nlon * nlat * state_num_2d & + + state_num_1d + +if (do_output()) write(*,*) 'nlon = ', nlon +if (do_output()) write(*,*) 'nlat = ', nlat +if (do_output()) write(*,*) 'nlev = ', nlev +if (do_output()) write(*,*) 'n3D = ', state_num_3d +if (do_output()) write(*,*) 'n2D = ', state_num_2d +if (do_output()) write(*,*) 'n1D = ', state_num_1d +if (do_output()) write(*,*) 'model_size = ', model_size + +allocate (ens_mean(model_size)) + +! Might as well use the Gregorian Calendar +call set_calendar_type('Gregorian') + +! The time_step in terms of a time type must also be initialized. +time_step = set_time(time_step_seconds, time_step_days) + +end subroutine static_init_model + + + +subroutine init_conditions(x) +!------------------------------------------------------------------ +! subroutine init_conditions(x) +! +! Returns a model state vector, x, that is some sort of appropriate +! initial condition for starting up a long integration of the model. +! At present, this is only used if the namelist parameter +! start_from_restart is set to .false. in the program perfect_model_obs. +! If this option is not to be used in perfect_model_obs, or if no +! synthetic data experiments using perfect_model_obs are planned, +! this can be a NULL INTERFACE. + +real(r8), intent(out) :: x(:) + +if ( .not. module_initialized ) call static_init_model + +end subroutine init_conditions + + + +subroutine adv_1step(x, time) +!------------------------------------------------------------------ +! subroutine adv_1step(x, time) +! +! Does a single timestep advance of the model. The input value of +! the vector x is the starting condition and x is updated to reflect +! the changed state after a timestep. The time argument is intent +! in and is used for models that need to know the date/time to +! compute a timestep, for instance for radiation computations. +! This interface is only called if the namelist parameter +! async is set to 0 in perfect_model_obs of filter or if the +! program integrate_model is to be used to advance the model +! state as a separate executable. If one of these options +! is not going to be used (the model will only be advanced as +! a separate model-specific executable), this can be a +! NULL INTERFACE. + +real(r8), intent(inout) :: x(:) +type(time_type), intent(in) :: time + +end subroutine adv_1step + + + +function get_model_size() +!------------------------------------------------------------------ +! +! Returns the size of the model as an integer. Required for all +! applications. + +integer :: get_model_size + +if ( .not. module_initialized ) call static_init_model + +get_model_size = model_size + +end function get_model_size + + + +subroutine init_time(time) +!------------------------------------------------------------------ +! +! Companion interface to init_conditions. Returns a time that is somehow +! appropriate for starting up a long integration of the model. +! At present, this is only used if the namelist parameter +! start_from_restart is set to .false. in the program perfect_model_obs. +! If this option is not to be used in perfect_model_obs, or if no +! synthetic data experiments using perfect_model_obs are planned, +! this can be a NULL INTERFACE. + +type(time_type), intent(out) :: time + +if ( .not. module_initialized ) call static_init_model + +! for now, just set to 0 +time = set_time(0,0) + +end subroutine init_time + + + +subroutine model_interpolate(x, location, itype, obs_val, istatus) +!------------------------------------------------------------------ +! +! Given a state vector, a location, and a model state variable type, +! interpolates the state variable field to that location and returns +! the value in obs_val. The istatus variable should be returned as +! 0 unless there is some problem in computing the interpolation in +! which case an alternate value should be returned. The itype variable +! is a model specific integer that specifies the type of field (for +! instance temperature, zonal wind component, etc.). In low order +! models that have no notion of types of variables, this argument can +! be ignored. For applications in which only perfect model experiments +! with identity observations (i.e. only the value of a particular +! state variable is observed), this can be a NULL INTERFACE. + +real(r8), intent(in) :: x(:) +type(location_type), intent(in) :: location +integer, intent(in) :: itype +real(r8), intent(out) :: obs_val +integer, intent(out) :: istatus + +integer :: local_var_type +integer :: i, vstatus, which_vert +integer :: lat_below, lat_above, lon_below, lon_above +integer :: zero_lon_index +real(r8) :: lon_fract, temp_lon, lat_fract +real(r8) :: lon, lat, height, lon_lat_lev(3) +real(r8) :: bot_lon, top_lon, delta_lon, bot_lat, top_lat, delta_lat +real(r8) :: val(2,2), a(2) + +if ( .not. module_initialized ) call static_init_model + + +! Default for successful return +istatus = 0 +vstatus = 0 + +! Get the position +! FOR NOW OBS VERTICAL LOCATION IS ALWAYS HEIGHT +lon_lat_lev = get_location(location) +lon = lon_lat_lev(1) ! degree +lat = lon_lat_lev(2) ! degree +if(vert_is_height(location)) then + height = lon_lat_lev(3) +elseif (vert_is_undef(location)) then + ! vertical location is undefined - e.g., MIDAS_TEC + height = missing_r8 +else + which_vert = nint(query_location(location)) + write(msgstring,*) 'vertical coordinate type:',which_vert,' cannot be handled' + call error_handler(E_ERR,'model_interpolate',msgstring,source,revision,revdate) +endif + +! Get lon and lat grid specs +bot_lon = lons(1) ! 180. +delta_lon = abs((lons(1)-lons(2))) ! 5. or 2.5 +zero_lon_index = int(bot_lon/delta_lon) + 1 ! 37 or 73 +top_lon = lons(nlon) ! 175. or 177.5 +bot_lat = lats(1) ! +top_lat = lats(nlat) ! +delta_lat = abs((lats(1)-lats(2))) ! + + +! Compute bracketing lon indices: +! TIEGCM [-180 175] DART [180, 185, ..., 355, 0, 5, ..., 175] +if(lon > top_lon .and. lon < bot_lon) then ! at wraparound point [175 < lon < 180] + lon_below = nlon + lon_above = 1 + lon_fract = (lon - top_lon) / delta_lon +else if (lon >= bot_lon) then ! [180 <= lon <= 360] + lon_below = int((lon - bot_lon) / delta_lon) + 1 + lon_above = lon_below + 1 + lon_fract = (lon - lons(lon_below)) / delta_lon +else ! [0 <= lon <= 175 ] + lon_below = int((lon - 0.0_r8) / delta_lon) + zero_lon_index + lon_above = lon_below + 1 + lon_fract = (lon - lons(lon_below)) / delta_lon +endif + +! Compute neighboring lat rows: TIEGCM [-87.5, 87.5] DART [-90, 90] +! NEED TO BE VERY CAREFUL ABOUT POLES; WHAT'S BEING DONE IS NOT GREAT! +if(lat >= bot_lat .and. lat <= top_lat) then ! -87.5 <= lat <= 87.5 + lat_below = int((lat - bot_lat) / delta_lat) + 1 + lat_above = lat_below + 1 + lat_fract = (lat - lats(lat_below) ) / delta_lat +else if(lat < bot_lat) then ! South of bottom lat + lat_below = 1 + lat_above = 1 + lat_fract = 1.0_r8 +else ! North of top lat + lat_below = nlat + lat_above = nlat + lat_fract = 1.0_r8 +endif + +! Now, need to find the values for the four corners +if (vert_is_undef(location)) then !2D fields + + if (itype == KIND_VERTICAL_TEC) then + local_var_type = TYPE_local_2D_TEC + val(1, 1) = x(get_index_2d(lat_below, lon_below, local_var_type)) + val(1, 2) = x(get_index_2d(lat_above, lon_below, local_var_type)) + val(2, 1) = x(get_index_2d(lat_below, lon_above, local_var_type)) + val(2, 2) = x(get_index_2d(lat_above, lon_above, local_var_type)) + endif + +else !3D fields + + call get_val(val(1, 1), x, lon_below, lat_below, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(1, 2), x, lon_below, lat_above, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(2, 1), x, lon_above, lat_below, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(2, 2), x, lon_above, lat_above, height, itype, vstatus) + +endif + +! istatus meaning return expected obs? assimilate? +! 0 obs and model are fine; yes yes +! 1 fatal problem; no no +! 2 exclude valid obs yes no +! +istatus = vstatus +if(istatus /= 1) then + do i = 1, 2 + a(i) = lon_fract * val(2, i) + (1.0_r8 - lon_fract) * val(1, i) + end do + obs_val = lat_fract * a(2) + (1.0_r8 - lat_fract) * a(1) +else + obs_val = missing_r8 +endif + + +end subroutine model_interpolate + + + +subroutine get_val(val, x, lon_index, lat_index, height, obs_kind, istatus) +!------------------------------------------------------------------ +! +real(r8), intent(out) :: val +real(r8), intent(in) :: x(:) +integer, intent(in) :: lon_index, lat_index +real(r8), intent(in) :: height +integer, intent(in) :: obs_kind +integer, intent(out) :: istatus +integer :: var_type +integer :: k, lev_top, lev_bottom +real(r8) :: zgrid, delta_z, zgrid_top, zgrid_bottom +real(r8) :: val_top, val_bottom, frac_lev + + +! No errors to start with +istatus = 0 + +! To find a layer height: what's the unit of height [m] +! pressure level ln(p0/p) -- interface [-7.0 7.0] and midlevel [-6.75 7.25] +! Ne and ZG are defined at interface +! T, U, V, O & O2 are defined at midlevel +! T, U, V at top midlevel pressure level are missing values in TIEGCM +! but filled in DART with the values at nlev -1 + +if (obs_kind == KIND_ELECTRON_DENSITY) then + + zgrid_bottom = & + x(get_index(lat_index,lon_index,1,TYPE_local_ZG))/100.0_r8 ![m] = /100 [cm] + zgrid_top = & + x(get_index(lat_index,lon_index,nlev,TYPE_local_ZG))/100.0_r8 + if ((zgrid_bottom > height) .or. (zgrid_top < height)) then + istatus = 1 !obs height is above or below the model boundary + val = 0.0 + return + endif + + h_loop_interface:do k = 2, nlev + + zgrid = x(get_index(lat_index,lon_index,k,TYPE_local_ZG))/100.0_r8 ![m] = /100 [cm] + + if (height <= zgrid) then + lev_top = k + lev_bottom = lev_top -1 + delta_z = zgrid - & + x(get_index(lat_index,lon_index,lev_bottom,TYPE_local_ZG))/100.0_r8 + frac_lev = (zgrid - height)/delta_z + exit h_loop_interface + endif + + enddo h_loop_interface + +else + + !mid_level 1 + zgrid_bottom = 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,1,TYPE_local_ZG)) + & ![m] = /100 [cm] + x(get_index(lat_index,lon_index,2,TYPE_local_ZG))) + + !mid_level nlev-1 + zgrid_top = 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,nlev-1,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,nlev,TYPE_local_ZG))) + + if ((zgrid_bottom > height) .or. (zgrid_top < height)) then + istatus = 1 !obs height is above or below the model boundary + val = 0.0 + return + endif + + h_loop_midpoint:do k = 2, nlev-1 + + zgrid = 0.50_r8 / 100.0_r8 * & ! [m] = ZGtiegcm/100 [cm] + (x(get_index(lat_index,lon_index,k,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,k+1,TYPE_local_ZG))) + + if (height <= zgrid) then + lev_top = k + lev_bottom = lev_top -1 + delta_z = zgrid - 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,lev_bottom,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,lev_bottom+1,TYPE_local_ZG))) + frac_lev = (zgrid - height)/delta_z + exit h_loop_midpoint + endif + + enddo h_loop_midpoint + +endif + + +if (obs_kind == KIND_ATOMIC_OXYGEN_MIXING_RATIO) then + + var_type = TYPE_local_O1 + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_MOLEC_OXYGEN_MIXING_RATIO) then + + var_type = TYPE_local_O2 + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_TEMPERATURE) then + + var_type = TYPE_local_TN + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_PRESSURE) then + + val_top = plevs(lev_top) !pressure at midpoint [Pa] + val_bottom = plevs(lev_bottom) !pressure at midpoint [Pa] + +elseif (obs_kind == KIND_ELECTRON_DENSITY) then + + var_type = TYPE_local_NE + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +else + + istatus = 1 + val = 0. + return + +endif + + +if (obs_kind == KIND_PRESSURE) then + val = exp(frac_lev * log(val_bottom) + (1.0 - frac_lev) * log(val_top)) +else +!KIND_ELECTRON_DENSITY +!KIND_TEMPERATURE +!KIND_MOLEC_OXYGEN_MIXING_RATIO +!KIND_ATOMIC_OXYGEN_MIXING_RATIO + val = frac_lev * val_bottom + (1.0 - frac_lev) * val_top +endif + +end subroutine get_val + + + +function get_index(lat_index, lon_index, lev_index, var_type) +!------------------------------------------------------------------ +! +integer, intent(in) :: lat_index, lon_index, lev_index, var_type +integer :: get_index +integer :: initial_3d_index + +initial_3d_index = 1 + +get_index = initial_3d_index & + + var_type + (lev_index -1)*state_num_3d & + + (lat_index -1)*state_num_3d*nlev & + + (lon_index -1)*state_num_3d*nlev*nlat + +end function get_index + + + +function get_index_2d(lat_index, lon_index, var_type) +!------------------------------------------------------------------ +! +integer, intent(in) :: lat_index, lon_index, var_type +integer :: get_index_2d +integer :: initial_2d_index + +initial_2d_index = 1 + state_num_3d * nlon * nlat * nlev + +get_index_2d = initial_2d_index & + + var_type + (lat_index -1)*state_num_2d & + + (lon_index -1)*state_num_2d*nlat + +end function get_index_2d + + + +function get_model_time_step() +!------------------------------------------------------------------ +! +! Returns the the time step of the model; the smallest increment +! in time that the model is capable of advancing the state in a given +! implementation. This interface is required for all applications. + +type(time_type) :: get_model_time_step + +if ( .not. module_initialized ) call static_init_model + +get_model_time_step = time_step + +end function get_model_time_step + + + +subroutine get_state_meta_data(index_in, location, var_type) +!------------------------------------------------------------------ +! +! Given an integer index into the state vector structure, returns the +! associated location. A second intent(out) optional argument kind +! can be returned if the model has more than one type of field (for +! instance temperature and zonal wind component). This interface is +! required for all filter applications as it is required for computing +! the distance between observations and state variables. + +integer, intent(in) :: index_in +type(location_type), intent(out) :: location +integer, optional, intent(out) :: var_type + +integer :: indx, num_per_col, col_num, col_elem +integer :: lon_index, lat_index, lev_index +real(r8) :: lon, lat, lev, height +integer :: local_var_type, var_type_temp +integer :: model_utsec +integer :: model_size_3d, model_size_2d, model_size_1d + +!model_size = model_size_3d + model_size_2d + model_size_1d +model_size_3d = state_num_3d * nlon * nlat * nlev +model_size_2d = state_num_2d * nlon * nlat +model_size_1d = state_num_1d + +if ( .not. module_initialized ) call static_init_model + +!--------------------------------------------------------------------------- +!--1D vector----------------------------------------------------- +if (index_in >= (model_size_3d + model_size_2d + 1)) then + +! PARAMETERS DO NOT HAVE LOCATION + local_var_type = KIND_1D_PARAMETER + lev = pilevs(22) !return a fake value + height = 400000_r8 !return a fake value + lat = 0.0_r8 !return a fake value + lat = 0.0_r8 !return a fake value + + location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) + +!--2D fields----------------------------------------------------- +elseif ((index_in >= model_size_3d +1 ) .and. & + (index_in <= (model_size_3d + model_size_2d))) then + +! Easier to compute with a 0 to size -1 index + indx = index_in - model_size_3d - 1 + +! Compute number of items per column + num_per_col = state_num_2d + +! What column is this index in + col_num = indx / num_per_col + col_elem = indx - col_num * num_per_col + +! what lon and lat index for this column + lon_index = col_num /nlat + lat_index = col_num - lon_index * nlat + +! Get actual lon lat values from static_init_model arrays + lon = lons(lon_index + 1) + lat = lats(lat_index + 1) + +! Find which var_type this element is +! var_type_temp = mod(col_elem, state_num_2d) +! May use var_type_temp to find var_type +! BUT now there is only one 2D fields type + local_var_type = KIND_VERTICAL_TEC + + if (local_var_type == KIND_VERTICAL_TEC) then + !vTEC is 2-D fields (height is not defined) + height = 300000_r8 !return a fake value + endif + + location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) + +!--3D fields--------------------------------------------------- +else + +! Easier to compute with a 0 to size -1 index + indx = index_in -1 + +! Compute number of items per column + num_per_col = nlev * state_num_3d + +! What column is this index in + col_num = indx / num_per_col + col_elem = indx - col_num * num_per_col + +! what lon and lat index for this column + lon_index = col_num /nlat + lat_index = col_num - lon_index * nlat + +! Now figure out which beast in column this is + lev_index = col_elem / state_num_3d + +! Get actual lon lat values from static_init_model arrays + lon = lons(lon_index + 1) + lat = lats(lat_index + 1) + +! Find which var_type this element is + var_type_temp = mod(col_elem, state_num_3d) + + if (var_type_temp == TYPE_local_ZG) then !ZG + local_var_type = KIND_GEOPOTENTIAL_HEIGHT + else if (var_type_temp == TYPE_local_TN) then !TN + local_var_type = KIND_TEMPERATURE + else if (var_type_temp == TYPE_local_TN_NM) then !TN_NM + local_var_type = KIND_TEMPERATURE + else if (var_type_temp == TYPE_local_O1) then !O1 + local_var_type = KIND_ATOMIC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_O1_NM) then !O1_NM + local_var_type = KIND_ATOMIC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_O2) then !O2 + local_var_type = KIND_MOLEC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_O2_NM) then !O2_NM + local_var_type = KIND_MOLEC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_UN) then !UN + local_var_type = KIND_U_WIND_COMPONENT + else if (var_type_temp == TYPE_local_UN_NM) then !UN_NM + local_var_type = KIND_U_WIND_COMPONENT + else if (var_type_temp == TYPE_local_VN) then !VN + local_var_type = KIND_V_WIND_COMPONENT + else if (var_type_temp == TYPE_local_VN_NM) then !VN_NM + local_var_type = KIND_V_WIND_COMPONENT + else if (var_type_temp == TYPE_local_NE) then !NE + local_var_type = KIND_ELECTRON_DENSITY + else + write(msgstring,*)"unknown var_type for index ",index_in + call error_handler(E_ERR,"get_state_meta_data", msgstring, source, revision, revdate) + endif + +!----------------------------------------------------- +!TIEGCM's 'natural' vertical coordinate is pressure +!if ((local_var_type == KIND_ELECTRON_DENSITY) .or. & !NE defined at interface levels +! (local_var_type == KIND_GEOPOTENTIAL_HEIGHT)) then !ZG defined at interface levels +! lev = pilevs(lev_index + 1) +!else !TN UN VN O1 defined at midpoints +! lev = plevs(lev_index + 1) +!endif +!location = set_location(lon,lat,lev,VERTISPRESSURE) !pressure(2),height(3) +!----------------------------------------------------- + + if ((local_var_type == KIND_ELECTRON_DENSITY) .or. & + (local_var_type == KIND_GEOPOTENTIAL_HEIGHT)) then + !NE defined at interface levels + !ZG defined at interface levels + height = ens_mean(get_index(lat_index+1,& + lon_index+1,& + lev_index+1,& + TYPE_local_ZG))/100.0_r8 ![m] = ZGtiegcm/100 [cm] + else + !TN UN VN O1 defined at midpoints + !TIEGCM: top midpoint slot contains missing values for TN UN VN + if (lev_index+2 > nlev) then + height = ens_mean(get_index(lat_index+1,lon_index+1, & + nlev,TYPE_local_ZG)) / 100.0_r8 + else + height = 0.50_r8 / 100.0_r8 * & + (ens_mean(get_index(lat_index+1,lon_index+1, & + lev_index+1,TYPE_local_ZG)) + & + ens_mean(get_index(lat_index+1,lon_index+1, & + lev_index+2,TYPE_local_ZG))) + endif + endif + + location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) + +endif +!--------------------------------------------------------------------------- +!--------------------------------------------------------------------------- + +! If the type is wanted, return it +if(present(var_type)) var_type = local_var_type + +end subroutine get_state_meta_data + + + +subroutine end_model() +!------------------------------------------------------------------ +! +! Does any shutdown and clean-up needed for model. Can be a NULL +! INTERFACE if the model has no need to clean up storage, etc. + +if ( .not. module_initialized ) call static_init_model + +end subroutine end_model + + + +function nc_write_model_atts( ncFileID ) result (ierr) +!------------------------------------------------------------------ +! TJH 24 Oct 2006 -- Writes the model-specific attributes to a netCDF file. +! This includes coordinate variables and some metadata, but NOT +! the model state vector. We do have to allocate SPACE for the model +! state vector, but that variable gets filled as the model advances. +! +! As it stands, this routine will work for ANY model, with no modification. +! +! The simplest possible netCDF file would contain a 3D field +! containing the state of 'all' the ensemble members. This requires +! three coordinate variables -- one for each of the dimensions +! [model_size, ensemble_member, time]. A little metadata is useful, +! so we can also create some 'global' attributes. +! This is what is implemented here. +! +! Once the simplest case is working, this routine (and nc_write_model_vars) +! can be extended to create a more logical partitioning of the state vector, +! fundamentally creating a netCDF file with variables that are easily +! plotted. The bgrid model_mod is perhaps a good one to view, keeping +! in mind it is complicated by the fact it has two coordinate systems. +! There are stubs in this template, but they are only stubs. +! +! TJH 29 Jul 2003 -- for the moment, all errors are fatal, so the +! return code is always '0 == normal', since the fatal errors stop execution. +! +! assim_model_mod:init_diag_output uses information from the location_mod +! to define the location dimension and variable ID. All we need to do +! is query, verify, and fill ... +! +! Typical sequence for adding new dimensions,variables,attributes: +! NF90_OPEN ! open existing netCDF dataset +! NF90_redef ! put into define mode +! NF90_def_dim ! define additional dimensions (if any) +! NF90_def_var ! define variables: from name, type, and dims +! NF90_put_att ! assign attribute values +! NF90_ENDDEF ! end definitions: leave define mode +! NF90_put_var ! provide values for variable +! NF90_CLOSE ! close: save updated netCDF dataset + + +integer, intent(in) :: ncFileID ! netCDF file identifier +integer :: ierr ! return value of function + +integer :: nDimensions, nVariables, nAttributes, unlimitedDimID + +integer :: StateVarDimID ! netCDF pointer to state variable dimension (model size) +integer :: MemberDimID ! netCDF pointer to dimension of ensemble (ens_size) +integer :: TimeDimID ! netCDF pointer to time dimension (unlimited) + +integer :: StateVarVarID ! netCDF pointer to state variable coordinate array +integer :: StateVarID ! netCDF pointer to 3D [state,copy,time] array + +integer :: TNVarID, TN_NMVarID, UNVarID, UN_NMVarID, VNVarID, VN_NMVarID +integer :: O1VarID, O1_NMVarID, O2VarID, O2_NMVarID +integer :: NEVarID, F107VarID, ZGVarID +integer :: lonDimID, latDimID, levDimID, ilevDimID +integer :: lonVarID, latVarID, levVarID, ilevVarID +integer :: paraDimID + +! we are going to need these to record the creation date in the netCDF file. +! This is entirely optional, but nice. + +character(len=8) :: crdate ! needed by F90 DATE_AND_TIME intrinsic +character(len=10) :: crtime ! needed by F90 DATE_AND_TIME intrinsic +character(len=5) :: crzone ! needed by F90 DATE_AND_TIME intrinsic +integer, dimension(8) :: values ! needed by F90 DATE_AND_TIME intrinsic +character(len=NF90_MAX_NAME) :: str1 + +integer :: i + +if ( .not. module_initialized ) call static_init_model + +!------------------------------------------------------------------------------- +! make sure ncFileID refers to an open netCDF file, +! and then put into define mode. +!------------------------------------------------------------------------------- + +ierr = -1 ! assume things go poorly + +call nc_check(nf90_Inquire(ncFileID, nDimensions, nVariables, & + nAttributes, unlimitedDimID), 'nc_write_model_atts','inquire') +call nc_check(nf90_Redef(ncFileID),'nc_write_model_atts','redef') + +!------------------------------------------------------------------------------- +! We need the dimension ID for the number of copies/ensemble members, and +! we might as well check to make sure that Time is the Unlimited dimension. +! Our job is create the 'model size' dimension. +!------------------------------------------------------------------------------- + +call nc_check(nf90_inq_dimid(ncid=ncFileID, name="copy", dimid=MemberDimID),& + 'nc_write_model_atts', 'copy dimid') +call nc_check(nf90_inq_dimid(ncid=ncFileID, name="time", dimid= TimeDimID),& + 'nc_write_model_atts', 'time dimid') + +if ( TimeDimID /= unlimitedDimId ) then + write(msgstring,*)"Time Dimension ID ",TimeDimID, & + " should equal Unlimited Dimension ID",unlimitedDimID + call error_handler(E_ERR,"nc_write_model_atts", msgstring, source, revision, revdate) +endif + +!------------------------------------------------------------------------------- +! Define the model size / state variable dimension / whatever ... +!------------------------------------------------------------------------------- +call nc_check(nf90_def_dim(ncid=ncFileID, name="StateVariable", & + len=model_size, dimid = StateVarDimID),& + 'nc_write_model_atts', 'state def_dim') + +!------------------------------------------------------------------------------- +! Write Global Attributes +!------------------------------------------------------------------------------- + +call DATE_AND_TIME(crdate,crtime,crzone,values) +write(str1,'(''YYYY MM DD HH MM SS = '',i4,5(1x,i2.2))') & + values(1), values(2), values(3), values(5), values(6), values(7) + +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "creation_date" ,str1 ),& + 'nc_write_model_atts', 'creation put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_source" ,source ),& + 'nc_write_model_atts', 'source put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_revision",revision),& + 'nc_write_model_atts', 'revision put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_revdate" ,revdate ),& + 'nc_write_model_atts', 'revdate put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model","TIEGCM" ),& + 'nc_write_model_atts', 'model put') + +!------------------------------------------------------------------------------- +! Here is the extensible part. The simplest scenario is to output the state vector, +! parsing the state vector into model-specific parts is complicated, and you need +! to know the geometry, the output variables (PS,U,V,T,Q,...) etc. We're skipping +! complicated part. +!------------------------------------------------------------------------------- + +if ( output_state_vector ) then + + !---------------------------------------------------------------------------- + ! Create a variable for the state vector + !---------------------------------------------------------------------------- + + ! Define the state vector coordinate variable and some attributes. + call nc_check(nf90_def_var(ncid=ncFileID,name="StateVariable", xtype=nf90_int, & + dimids=StateVarDimID, varid=StateVarVarID), & + 'nc_write_model_atts', 'statevariable def_var') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "long_name", "State Variable ID"), & + 'nc_write_model_atts', 'statevariable long_name') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "units", "indexical"), & + 'nc_write_model_atts', 'statevariable units') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "valid_range", (/ 1, model_size /)), & + 'nc_write_model_atts', 'statevariable valid_range') + + ! Define the actual (3D) state vector, which gets filled as time goes on ... + call nc_check(nf90_def_var(ncid=ncFileID, name="state", xtype=nf90_real, & + dimids = (/ StateVarDimID, MemberDimID, unlimitedDimID /), & + varid=StateVarID), 'nc_write_model_atts', 'state def_var') + call nc_check(nf90_put_att(ncFileID, StateVarID, "long_name", "model state or fcopy"), & + 'nc_write_model_atts', 'state long_name') + + ! Leave define mode so we can fill the coordinate variable. + call nc_check(nf90_enddef(ncfileID), 'nc_write_model_atts', 'state enddef') + + ! Fill the state variable coordinate variable + call nc_check(nf90_put_var(ncFileID, StateVarVarID, (/ (i,i=1,model_size) /) ), & + 'nc_write_model_atts', 'state put_var') + +else + + !---------------------------------------------------------------------------- + ! We need to process the prognostic variables. + !---------------------------------------------------------------------------- + + ! This block is a stub for something more complicated. + ! Usually, the control for the execution of this block is a namelist variable. + ! Take a peek at the bgrid model_mod.f90 for a (rather complicated) example. + + !---------------------------------------------------------------------------- + ! Define the dimensions IDs + !---------------------------------------------------------------------------- + + call nc_check(nf90_def_dim(ncid=ncFileID, name="lon", & + & len = nlon, dimid = lonDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="lat", & + & len = nlat, dimid = latDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="lev", & + & len = nlev, dimid = levDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="ilev", & + & len = nilev, dimid = ilevDimID), 'nc_write_model_atts') + + if (state_num_1d > 0) then + call nc_check(nf90_def_dim(ncid=ncFileID, name="onedparameter", & + & len = state_num_1d, dimid = paraDimID), 'nc_write_model_atts') + endif + + !---------------------------------------------------------------------------- + ! Create the (empty) Variables and the Attributes + !---------------------------------------------------------------------------- + + call nc_check(nf90_def_var(ncFileID, name="lon", & + & xtype=nf90_double, dimids=lonDimID, varid=lonVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, & + & "long_name", "geographic longitude (-west, +east)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, "units", "degrees_east"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, "valid_range", & + & (/ -180.0_r8, 180.0_r8 /)),'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="lat", & + & xtype=nf90_double, dimids=latDimID, varid=latVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, & + & "long_name", "geographic latitude (-south +north)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, "units", "degrees_north"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, "valid_range", & + & (/ -90.0_r8, 90.0_r8 /)),'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="lev", & + & xtype=nf90_double, dimids=levDimID, varid=levVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "long_name", "midpoint levels"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "short_name", "ln(p0/p)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "units", ""),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "positive", "up"),& + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="ilev", & + & xtype=nf90_double, dimids=ilevDimID, varid=ilevVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "long_name", "interface levels"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "short_name", "ln(p0/p)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "units", ""),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "positive", "up"),& + 'nc_write_model_atts') + + !---------------------------------------------------------------------------- + ! Create attributes for the state vector + !---------------------------------------------------------------------------- + + if (state_num_1d > 0) then + call nc_check(nf90_def_var(ncid=ncFileID, name="F107", xtype=nf90_real, & + dimids = (/ paraDimID, MemberDimID, unlimitedDimID /), & + varid = F107VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, F107VarID, "long_name", "f107"), & + 'nc_write_model_atts') + endif + + call nc_check(nf90_def_var(ncid=ncFileID, name="ZG", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = ZGVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ZGVarID, "long_name", & + "geopotential height calculated with varying gravity"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ZGVarID, "units", "cm"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="TN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = TNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TNVarID, "long_name", "neutral temperature"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TNVarID, "units", "K"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="TN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = TN_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TN_NMVarID, "long_name", & + "neutral temperature (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TN_NMVarID, "units", "K"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="O1", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O1VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1VarID, "long_name", "atomic oxygen"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1VarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name='O1_NM', xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O1_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1_NMVarID, "long_name", "atomic oxygen (time N-1)"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1_NMVarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="O2", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O2VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2VarID, "long_name", "atomic oxygen"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2VarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name='O2_NM', xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O2_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2_NMVarID, "long_name", "atomic oxygen (time N-1)"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2_NMVarID, "units", "mmr"), & + 'nc_write_model_atts') + + if (.not. only_neutral_density) then + call nc_check(nf90_def_var(ncid=ncFileID, name="UN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = UNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UNVarID, "long_name", & + "neutral zonal wind (+east)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UNVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="UN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = UN_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UN_NMVarID, "long_name", & + "neutral zonal wind (+east) (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UN_NMVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="VN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = VNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VNVarID, "long_name", & + "neutral meridional wind (+north)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VNVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="VN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = VN_NMVarID),'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VN_NMVarID, "long_name", & + "neutral meridional wind (+north) (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VN_NMVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="NE", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, ilevDimID, MemberDimID, unlimitedDimID /), & + varid = NEVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, NEVarID, "long_name", "electron density"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, NEVarID, "units", "cm-3"), & + 'nc_write_model_atts') + endif ! (.not. only_neutral_density) + + call nc_check(nf90_enddef(ncfileID), 'nc_write_model_atts', 'prognostic enddef') + + !------------------------------------------------------------------------------- + ! Fill the variables + !------------------------------------------------------------------------------- + + call nc_check(nf90_put_var(ncFileID, lonVarID, lons), & + 'nc_write_model_atts', 'put_var lons') + call nc_check(nf90_put_var(ncFileID, latVarID, lats), & + 'nc_write_model_atts', 'put_var lats') + call nc_check(nf90_put_var(ncFileID, levVarID, levs), & + 'nc_write_model_atts', 'put_var levs') + call nc_check(nf90_put_var(ncFileID,ilevVarID,ilevs), & + 'nc_write_model_atts', 'put_var ilevs') + +endif + +!------------------------------------------------------------------------------- +! Flush the buffer and leave netCDF file open +!------------------------------------------------------------------------------- + +call nc_check(nf90_sync(ncFileID), 'nc_write_model_atts', 'sync') +if (do_output()) write (*,*) 'nc_write_model_atts: netCDF file ', ncFileID, ' is synched ' + +ierr = 0 ! If we got here, things went well. + +end function nc_write_model_atts + + + +function nc_write_model_vars( ncFileID, statevec, copyindex, timeindex ) result (ierr) +!------------------------------------------------------------------ +! TJH 24 Oct 2006 -- Writes the model variables to a netCDF file. +! +! TJH 29 Jul 2003 -- for the moment, all errors are fatal, so the +! return code is always '0 == normal', since the fatal errors stop execution. +! +! For the lorenz_96 model, each state variable is at a separate location. +! that's all the model-specific attributes I can think of ... +! +! assim_model_mod:init_diag_output uses information from the location_mod +! to define the location dimension and variable ID. All we need to do +! is query, verify, and fill ... +! +! Typical sequence for adding new dimensions,variables,attributes: +! NF90_OPEN ! open existing netCDF dataset +! NF90_redef ! put into define mode +! NF90_def_dim ! define additional dimensions (if any) +! NF90_def_var ! define variables: from name, type, and dims +! NF90_put_att ! assign attribute values +! NF90_ENDDEF ! end definitions: leave define mode +! NF90_put_var ! provide values for variable +! NF90_CLOSE ! close: save updated netCDF dataset + +integer, intent(in) :: ncFileID ! netCDF file identifier +real(r8), dimension(:), intent(in) :: statevec +integer, intent(in) :: copyindex +integer, intent(in) :: timeindex +integer :: ierr ! return value of function + +integer :: nDimensions, nVariables, nAttributes, unlimitedDimID +integer :: StateVarID +integer :: TNVarID, TN_NMVarID, UNVarID, UN_NMVarID, VNVarID, VN_NMVarID +integer :: O1VarID, O1_NMVarID, O2VarID, O2_NMVarID +integer :: NEVarID, F107VarID, ZGVarID + +type(model_type):: var + +if ( .not. module_initialized ) call static_init_model + +!------------------------------------------------------------------------------- +! make sure ncFileID refers to an open netCDF file, +!------------------------------------------------------------------------------- + +ierr = -1 ! assume things go poorly + +call nc_check(nf90_Inquire(ncFileID, nDimensions, nVariables, & + nAttributes, unlimitedDimID), 'nc_write_model_vars', 'inquire') + +if ( output_state_vector ) then + + call nc_check(NF90_inq_varid(ncFileID, 'state', StateVarID), & + 'nc_write_model_vars', 'state inq_varid' ) + call nc_check(NF90_put_var(ncFileID, StateVarID, statevec, & + start=(/ 1, copyindex, timeindex /)), & + 'nc_write_model_vars', 'state put_var') + +else + + !---------------------------------------------------------------------------- + ! We need to process the prognostic variables. + !---------------------------------------------------------------------------- + + ! This block is a stub for something more complicated. + ! Usually, the control for the execution of this block is a namelist variable. + ! Take a peek at the bgrid model_mod.f90 for a (rather complicated) example. + ! + ! Generally, it is necessary to take the statevec and decompose it into + ! the separate prognostic variables. In this (commented out) example, + ! global_Var is a user-defined type that has components like: + ! global_Var%ps, global_Var%t, ... etc. Each of those can then be passed + ! directly to the netcdf put_var routine. This may cause a huge storage + ! hit, so large models may want to avoid the duplication if possible. + + call init_model_instance(var) + call vector_to_prog_var(statevec, var) + + ! the 'start' array is crucial. In the following example, 'ps' is a 2D + ! array, and the netCDF variable "ps" is a 4D array [lat,lon,copy,time] + ! + ! call check(NF90_inq_varid(ncFileID, "ps", psVarID), "ps inq_varid") + ! call check(nf90_put_var( ncFileID, psVarID, global_Var%ps, & + ! start=(/ 1, 1, copyindex, timeindex /) ), "ps put_var") + + if (state_num_1d > 0) then + call nc_check(NF90_inq_varid(ncFileID, 'F107', F107VarID), & + 'nc_write_model_vars', 'F107 inq_varid') + call nc_check(nf90_put_var( ncFileID, F107VarID, var%vars_1d(1), & + start=(/ 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'F107 put_var') + endif + + call nc_check(NF90_inq_varid(ncFileID, 'ZG', ZGVarID), & + 'nc_write_model_vars', 'ZG inq_varid') + call nc_check(nf90_put_var( ncFileID, ZGVarID, & + var%vars_3d(:,:,:,TYPE_local_ZG+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'ZG put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'TN', TNVarID), & + 'nc_write_model_vars', 'TN inq_varid') + call nc_check(nf90_put_var( ncFileID, TNVarID, & + var%vars_3d(:,:,:,TYPE_local_TN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'TN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'TN_NM', TN_NMVarID), & + 'nc_write_model_vars', 'TN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, TN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_TN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'TN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O1', O1VarID), & + 'nc_write_model_vars', 'O1 inq_varid') + call nc_check(nf90_put_var( ncFileID, O1VarID, & + var%vars_3d(:,:,:,TYPE_local_O1+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O1 put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O1_NM', O1_NMVarID), & + 'nc_write_model_vars', 'O1_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, O1_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_O1_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O1_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O2', O2VarID), & + 'nc_write_model_vars', 'O2 inq_varid') + call nc_check(nf90_put_var( ncFileID, O2VarID, & + var%vars_3d(:,:,:,TYPE_local_O2+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O2 put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O2_NM', O2_NMVarID), & + 'nc_write_model_vars', 'O2_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, O2_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_O2_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O2_NM put_var') + + if (.not. only_neutral_density) then + call nc_check(NF90_inq_varid(ncFileID, 'UN', UNVarID), & + 'nc_write_model_vars', 'UN inq_varid') + call nc_check(nf90_put_var( ncFileID, UNVarID, & + var%vars_3d(:,:,:,TYPE_local_UN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'UN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'UN_NM', UN_NMVarID), & + 'nc_write_model_vars', 'UN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, UN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_UN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'UN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'VN', VNVarID), & + 'nc_write_model_vars', 'VN inq_varid') + call nc_check(nf90_put_var( ncFileID, VNVarID, & + var%vars_3d(:,:,:,TYPE_local_VN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'VN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'VN_NM', VN_NMVarID), & + 'nc_write_model_vars', 'VN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, VN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_VN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'VN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'NE', NEVarID), & + 'nc_write_model_vars', 'NE inq_varid') + call nc_check(nf90_put_var( ncFileID, NEVarID, & + var%vars_3d(:,:,:,TYPE_local_NE+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'NE put_var') + endif !(.not. only_neutral_density) +endif + +!------------------------------------------------------------------------------- +! Flush the buffer and leave netCDF file open +!------------------------------------------------------------------------------- + +if (do_output()) write (*,*) 'nc_write_model_vars: Finished filling variables ' +call nc_check(nf90_sync(ncFileID), 'nc_write_model_vars', 'sync') +if (do_output()) write (*,*) 'nc_write_model_vars: netCDF file is synched ' + +ierr = 0 ! If we got here, things went well. + +call end_model_instance(Var) ! should avoid any memory leaking + +end function nc_write_model_vars + + + +subroutine pert_model_state(state, pert_state, interf_provided) +!------------------------------------------------------------------ +! +! Perturbs a model state for generating initial ensembles. +! The perturbed state is returned in pert_state. +! A model may choose to provide a NULL INTERFACE by returning +! .false. for the interf_provided argument. This indicates to +! the filter that if it needs to generate perturbed states, it +! may do so by adding an O(0.1) magnitude perturbation to each +! model state variable independently. The interf_provided argument +! should be returned as .true. if the model wants to do its own +! perturbing of states. + +real(r8), intent(in) :: state(:) +real(r8), intent(out) :: pert_state(:) +logical, intent(out) :: interf_provided + +integer :: i, variable_type +type(location_type) :: temp_loc + +if ( .not. module_initialized ) call static_init_model + +! An interface is provided +interf_provided = .true. + +! If first call initialize random sequence +! CAUTION: my_task_id is NOT emsemble member number +! For example, my_task_id will be in [0,N-1] +! if a single instance of the model using N MPI tasks. + +if(first_pert_call) then + call init_random_seq(random_seq,my_task_id()) + first_pert_call = .false. +endif + +do i = 1, get_model_size() + call get_state_meta_data(i, temp_loc, variable_type) + if(variable_type == KIND_1D_PARAMETER) then + pert_state(i) = random_gaussian(random_seq,state(i),20.0_r8) + else + pert_state(i) = state(i) + endif +end do + +end subroutine pert_model_state + + + +subroutine prog_var_to_vector(var, x) +!======================================================================= +! +! Copies fields to straight vector +! + +type(model_type), intent(in) :: var +real(r8), intent(out) :: x(:) + +integer :: i, j, k, nf, indx + +if ( .not. module_initialized ) call static_init_model + +indx = 0 + +!3D fields +loop_longitude: do i = 1, nlon + loop_latitude: do j = 1, nlat + loop_level: do k = 1, nlev + loop_var: do nf = 1, state_num_3d + indx = indx + 1 + x(indx) = var%vars_3d(i,j,k,nf) + enddo loop_var + enddo loop_level + enddo loop_latitude + enddo loop_longitude + + +!2D fields +loop_longitude_2d: do i = 1, nlon + loop_latitude_2d: do j = 1, nlat + loop_var_2d: do nf = 1, state_num_2d + indx = indx + 1 + x(indx) = var%vars_2d(i,j,nf) + enddo loop_var_2d + enddo loop_latitude_2d + enddo loop_longitude_2d + +!1D vector +loop_1d_var: do nf = 1, state_num_1d + indx = indx + 1 + x(indx) = var%vars_1d(nf) +enddo loop_1d_var + +if(indx /= model_size) then + write(msgstring, *) 'indx ',indx,' model_size ',model_size,' must be equal ' + call error_handler(E_ERR, 'prog_var_to_vector', msgstring, source, revision, revdate) +endif + +end subroutine prog_var_to_vector + + + +subroutine vector_to_prog_var(x, var) +!================================================================== +! +! Copies fields from straight vector +! + +real(r8), intent(in) :: x(:) +type(model_type), intent(out) :: var +integer :: i, j, k, nf, indx + +if ( .not. module_initialized ) call static_init_model + +indx = 0 + +!3D fields +loop_longitude: do i = 1, nlon + loop_latitude: do j = 1, nlat + loop_level: do k = 1, nlev + loop_var: do nf = 1, state_num_3d + indx = indx + 1 + + !for O&O2 ratio + if(nf==4 .or. nf==5 .or. nf==6 .or. nf==7) then + if(x(indx)<0) then + var%vars_3d(i,j,k,nf) = 0.00001 + elseif(x(indx)>1) then + var%vars_3d(i,j,k,nf) = 0.98888 + else + var%vars_3d(i,j,k,nf) = x(indx) + endif + + ! for NE + elseif (nf==12 .and. x(indx)<1) then + var%vars_3d(i,j,k,nf) = 1 + + ! for other variables + else + var%vars_3d(i,j,k,nf) = x(indx) + endif + + enddo loop_var + enddo loop_level + enddo loop_latitude + enddo loop_longitude + +!2D fields +loop_longitude_2d: do i = 1, nlon + loop_latitude_2d: do j = 1, nlat + loop_var_2d: do nf = 1, state_num_2d + indx = indx + 1 + var%vars_2d(i,j,nf) = x(indx) + enddo loop_var_2d + enddo loop_latitude_2d + enddo loop_longitude_2d + +!1D vector +loop_1d_var: do nf = 1, state_num_1d + indx = indx + 1 + var%vars_1d(nf) = x(indx) +enddo loop_1d_var + +if(indx /= model_size) then + write(msgstring, *) 'indx ',indx,' model_size ',model_size,' must be equal ' + call error_handler(E_ERR, 'vector_to_prog_var', msgstring, source, revision, revdate) +endif + +end subroutine vector_to_prog_var + + +subroutine init_model_instance(var,valid_time) +!================================================================== +! +! Initializes an instance of TIEGCM model state variables +! + +type(model_type), intent(out) :: var +type(time_type), optional, intent(in) :: valid_time + +if ( .not. module_initialized ) call static_init_model + +allocate(var%vars_3d(nlon, nlat, nlev, state_num_3d)) + +if (state_num_2d > 0) then + allocate(var%vars_2d(nlon, nlat, state_num_2d)) +endif + +if (state_num_1d > 0) then + allocate(var%vars_1d(state_num_1d)) +endif + +if (present(valid_time)) then + var%valid_time = valid_time +else + var%valid_time = set_time_missing() +endif + +end subroutine init_model_instance + + + +subroutine end_model_instance(var) +!================================================================== +! +! Ends an instance of TIEGCM model state variables +! + +type(model_type), intent(inout) :: var + +if ( .not. module_initialized ) call static_init_model + +deallocate(var%vars_3d) +if (state_num_2d > 0) deallocate(var%vars_2d) +if (state_num_1d > 0) deallocate(var%vars_1d) + +end subroutine end_model_instance + + + +subroutine update_TIEGCM_restart(file_name, var) +!======================================================================= +! +! Updates TIEGCM restart file fields +! + + character (len = *), intent(in) :: file_name + type(model_type), intent(in) :: var + + integer :: ncerr + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_id + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: utsec, doy !year + + real(r8), dimension(nlon,nlat,nlev) :: TN, TN_NM, UN, UN_NM, VN, VN_NM + real(r8), dimension(nlon,nlat,nlev) :: O1, O1_NM, O2, O2_NM + real(r8), dimension(nlon,nlat,nilev):: NE + + integer :: nlevm1 + type(time_type) :: jan1, tbase + integer :: year, month, day, hour, mins, sec + + if ( .not. module_initialized ) call static_init_model + + nlevm1 = nlev -1 + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + if (do_output()) print *, 'update_TIEGCM_restart: opening restart' + ncerr = nf90_open( file_name, NF90_WRITE, restart_id )! open with read/write access + call nc_check(ncerr, 'update_TIEGCM_restart','open') ! will die if error + if (do_output()) print *, 'update_TIEGCM_restart: opened with '//trim(nf90_strerror(ncerr)) + + + !... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'lev', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lev') + if (dim_len .ne. nlev) then + write(msgstring, *) trim(file_name), ' dim_lev = ',dim_len, ' DART expects ',nlev + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'update_TIEGCM_restart', 'inquire id of unlimited dimension time') + call nc_check( nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'update_TIEGCM_restart', 'inquire_dimension time') + + +!... put variables into TIEGCM array + + TN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_TN+1) + TN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + TN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_TN_NM+1) + TN_NM(:,:, nlev ) = TIEGCM_missing_value !fill top slot with missing value + + O1 = var%vars_3d(:,:,:,TYPE_local_O1+1) + O1_NM = var%vars_3d(:,:,:,TYPE_local_O1_NM+1) + O2 = var%vars_3d(:,:,:,TYPE_local_O2+1) + O2_NM = var%vars_3d(:,:,:,TYPE_local_O2_NM+1) + + if (.not. only_neutral_density) then + UN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_UN+1) + UN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + UN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_UN_NM+1) + UN_NM(:,:,nlev) = TIEGCM_missing_value !fill top slot with missing value + + VN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_VN+1) + VN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + VN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_VN_NM+1) + VN_NM(:,:,nlev) = TIEGCM_missing_value !fill top slot with missing value + + NE = var%vars_3d(:,:,:,TYPE_local_NE+1) + endif ! (.not. only_neutral_density) + + + call nc_check( nf90_inq_varid(restart_id, 'TN', var_id), & + 'update_TIEGCM_restart', 'inq_varid TN') + call nc_check( nf90_put_var(restart_id, var_id, values=TN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var TN') + + + call nc_check( nf90_inq_varid(restart_id, 'TN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid TN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=TN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var TN_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'O1', var_id), & + 'update_TIEGCM_restart', 'inq_varid O1') + call nc_check( nf90_put_var(restart_id, var_id, values=O1, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O1') + + + call nc_check( nf90_inq_varid(restart_id, 'O1_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid O1_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=O1_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O1_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'O2', var_id), & + 'update_TIEGCM_restart', 'inq_varid O2') + call nc_check( nf90_put_var(restart_id, var_id, values=O2, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O2') + + + call nc_check( nf90_inq_varid(restart_id, 'O2_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid O2_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=O2_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O2_NM') + + if (.not. only_neutral_density) then + call nc_check( nf90_inq_varid(restart_id, 'UN', var_id), & + 'update_TIEGCM_restart', 'inq_varid UN') + call nc_check( nf90_put_var(restart_id, var_id, values=UN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var UN') + + + call nc_check( nf90_inq_varid(restart_id, 'UN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid UN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=UN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var UN_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'VN', var_id), & + 'update_TIEGCM_restart', 'inq_varid VN') + call nc_check( nf90_put_var(restart_id, var_id, values=VN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var VN') + + + call nc_check( nf90_inq_varid(restart_id, 'VN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid VN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=VN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var VN_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'NE', var_id), & + 'update_TIEGCM_restart', 'inq_varid NE') + call nc_check( nf90_put_var(restart_id, var_id, values=NE, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nilev,1/)), & + 'update_TIEGCM_restart', 'put_var NE') + endif ! (.not. only_neutral_density) + +!... mtime and year + call get_date(var%valid_time, year, month, day, hour, mins, sec ) + jan1 = set_date(year,1,1) + tbase = var%valid_time - jan1 ! total time since the start of the year. + + call get_time(tbase, utsec, doy) + + mtime(1) = doy + 1 ! Have to add January 1 back in + mtime(2) = hour + mtime(3) = mins + + if (do_output()) print *, 'update_TIEGCM_restart: mtime (doy/hour/minute):', mtime + call nc_check( nf90_inq_varid(restart_id, 'mtime', var_id), & + 'update_TIEGCM_restart','inq_varid mtime') + call nc_check( nf90_put_var( restart_id, var_id, values=mtime, & + start = (/1,dim_time_len/), count = (/nmtime,1/)), & + 'update_TIEGCM_restart','get_var mtime') + + if (do_output()) print *, 'update_TIEGCM_restart: year:', year + call nc_check( nf90_inq_varid(restart_id, 'year', var_id), & + 'update_TIEGCM_restart','inq_varid year') + call nc_check( nf90_put_var( restart_id, var_id, values=year, & + start = (/dim_time_len/)) , & + 'update_TIEGCM_restart','get_var year') + + call nc_check( nf90_sync(restart_id), 'update_TIEGCM_restart', 'sync') + + call nc_check( nf90_close(restart_id), 'update_TIEGCM_restart', 'close') + + +end subroutine update_TIEGCM_restart + + + +subroutine read_TIEGCM_restart(file_name, var, model_time) +!======================================================================= +! +! Read TIEGCM restart file fields +! + + character (len = *), intent(in) :: file_name + type(model_type), intent(out):: var + type(time_type), intent(out):: model_time + + integer :: ncerr + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_Vtmp_id, var_mtime_id, var_year_id + real(r8), dimension(nlon,nlat,nlev) :: TN, TN_NM, UN, UN_NM, VN, VN_NM + real(r8), dimension(nlon,nlat,nlev) :: O1, O1_NM, O2, O2_NM + real(r8), dimension(nlon,nlat,nlev) :: TI, TE + real(r8), dimension(nlon,nlat,nilev) :: NE, NEm, Z, ZGG + integer :: nlev10 + real(r8), dimension(nlon,nlat,nlev+10) :: ZGG_extended, NEm_extended !nlev10 + real(r8), dimension(nlon,nlat) :: vTEC, Tplasma, Hplasma, GRAVITYtop + real(r8), dimension(nlev+9) :: delta_ZGG, NEm_middle !nlev10-1 + real(r8), parameter :: k_constant = 1.381e-23_r8 ! m^2 * kg / s^2 / K + real(r8), parameter :: omass = 2.678e-26_r8 ! mass of atomic oxgen kg + real(r8) :: earth_radiusm + integer, dimension(:), allocatable :: yeartmp + integer, dimension(:,:), allocatable :: mtimetmp + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: year, utsec, doy + integer :: nlevm1 + integer :: j, k + + if ( .not. module_initialized ) call static_init_model + + nlevm1 = nlev - 1 + + if( .not. file_exist(file_name)) then + write(msgstring,*)trim(file_name)//' does not exist.' + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_restart:reading restart:', file_name + + call nc_check( nf90_open( file_name, NF90_NOWRITE, restart_id ), & + 'read_TIEGCM_restart', 'open') + +!... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lev', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lev') + if (dim_len .ne. nlev) then + write(msgstring, *) trim(file_name), ' dim_lev = ',dim_len, ' DART expects ',nlev + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_restart', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_restart', 'inquire_dimension time') + + +!... TN + call nc_check(nf90_inq_varid(restart_id, 'TN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TN') + +!... TN_NM + call nc_check(nf90_inq_varid(restart_id, 'TN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TN_NM') + +!... O1 + call nc_check(nf90_inq_varid(restart_id, 'O1', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O1') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O1, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O1') + +!... O1_NM + call nc_check(nf90_inq_varid(restart_id, 'O1_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O1_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O1_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O1_NM') + +!... O2 + call nc_check(nf90_inq_varid(restart_id, 'O2', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O2') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O2, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O2') + +!... O2_NM + call nc_check(nf90_inq_varid(restart_id, 'O2_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O2_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O2_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O2_NM') + + if (.not. only_neutral_density) then +!... UN + call nc_check(nf90_inq_varid(restart_id, 'UN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid UN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=UN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var UN') + +!... UN_NM + call nc_check(nf90_inq_varid(restart_id, 'UN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid UN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=UN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var UN_NM') + +!... VN + call nc_check(nf90_inq_varid(restart_id, 'VN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid VN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=VN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var VN') + +!... VN_NM + call nc_check(nf90_inq_varid(restart_id, 'VN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid VN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=VN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var VN_NM') + +!... NE + call nc_check(nf90_inq_varid(restart_id, 'NE', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid NE') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=NE, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_restart', 'get_var NE') + endif ! (.not. only_neutral_density) + + + if (include_vTEC) then + + if (only_neutral_density) then +!... NE + call nc_check(nf90_inq_varid(restart_id, 'NE', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid NE') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=NE, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_restart', 'get_var NE') + endif ! (only_neutral_density) + +!... TI (midpoints) + call nc_check(nf90_inq_varid(restart_id, 'TI', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TI') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TI, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TI') + +!... TE (midpoints) + call nc_check(nf90_inq_varid(restart_id, 'TE', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TE') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TE, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TE') + +!... Z (interfaces) + call nc_check(nf90_inq_varid(restart_id, 'Z', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid Z') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=Z, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_restart', 'get_var Z') + +!... vTEC + + ! Convert Z (geoponential height) in cm to m + Z = Z * 1.0e-2_r8 + ! Convert earth_radius in Km to m + earth_radiusm = earth_radius * 1000.0_r8 + ! Convert to geometric height from geopotential height + ZGG = (earth_radiusm*Z) / (earth_radiusm - Z) + ! Convert NE in #/cm^3 to #/m^3 + NEm = NE * 1.0e+6 + ! Gravity at the top layer + GRAVITYtop(:,:) = gravity * (earth_radiusm / (earth_radiusm + ZGG(:,:,nilev))) ** 2 + ! Plasma Temperature + Tplasma(:,:) = (TI(:,:,nlev-1) + TE(:,:,nlev-1)) / 2.0_r8 + ! Compute plasma scale height + Hplasma = (2.0_r8 * k_constant / omass ) * Tplasma / GRAVITYtop + ! NE is extrapolated to 10 more layers + nlev10 = nlev + 10 + ZGG_extended(:,:,1:nlev) = ZGG + NEm_extended(:,:,1:nlev) = NEm + do j = nlev, nlev10 + NEm_extended(:,:,j) = 2.0_r8 * NEm_extended(:,:,j-1) * exp(-1.0_r8) + ZGG_extended(:,:,j) = ZGG_extended(:,:,j-1) + Hplasma(:,:) / 2.0_r8 + enddo + + do k = 1, nlon + do j = 1, nlat + delta_ZGG(1:(nlev10-1)) = ZGG_extended(k,j,2:nlev10)-ZGG_extended(k,j,1:(nlev10-1)) + NEm_middle(1:(nlev10-1))= NEm_extended(k,j,2:nlev10)+NEm_extended(k,j,1:(nlev10-1))/2.0_r8 + vTEC(k,j) = sum(NEm_middle * delta_ZGG) * 1.0e-16 ! Convert to TECU (1.0e+16 #/m^2) + enddo + enddo + + endif ! (include_vTEC) + + +!... get mtime + call nc_check(nf90_inq_dimid(restart_id, 'mtimedim', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid mtimedim') + call nc_check(nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension mtimedim') + if (dim_len .ne. nmtime) then + write(msgstring, *) trim(file_name), ' mtimedim = ',dim_len, ' DART expects ', nmtime + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + allocate(mtimetmp(dim_len, dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'mtime', var_mtime_id), & + 'read_TIEGCM_restart', 'inq_varid mtime') + call nc_check(nf90_get_var(restart_id, var_mtime_id, values=mtimetmp), & + 'read_TIEGCM_restart', 'get_var mtime') + mtime = mtimetmp(:,dim_time_len) + deallocate(mtimetmp) + +!... get year + allocate(yeartmp(dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'year', var_year_id), & + 'read_TIEGCM_restart', 'inq_varid year') + call nc_check(nf90_get_var(restart_id, var_year_id, values=yeartmp), & + 'read_TIEGCM_restart', 'get_var year') + year = yeartmp(dim_time_len) + deallocate(yeartmp) + +!... close the file + call nc_check(nf90_close( restart_id),'read_TIEGCM_restart','close') + +!... Now we want to convert the year/doy/hour/minute to a dart time. +!... We start by finding the dart time of the year and adding the rest to it. + + if (do_output()) print *, 'read_TIEGCM_restart: mtime (doy/hour/minute) and year:', mtime, year + + doy = mtime(1) + utsec = (mtime(2)*60 + mtime(3))*60 + + model_time = set_time(utsec, doy-1) + set_date(year, 1, 1) ! Jan 1 of whatever year. + + var%valid_time = model_time + + if (do_output()) call print_time(model_time, str=" read_TIEGCM_restart: model_time ") + if (do_output()) call print_date(model_time, str=" read_TIEGCM_restart: model_date ") + +!... fill DART state vector with TIEGCM variables + + var%vars_3d(:,:,1:nlevm1,TYPE_local_TN+1) = TN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_TN+1) = TN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_TN_NM+1) = TN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_TN_NM+1) = TN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,:,TYPE_local_O1+1) = O1 + var%vars_3d(:,:,:,TYPE_local_O1_NM+1) = O1_NM + + var%vars_3d(:,:,:,TYPE_local_O2+1) = O2 + var%vars_3d(:,:,:,TYPE_local_O2_NM+1) = O2_NM + + if (.not. only_neutral_density) then + var%vars_3d(:,:,1:nlevm1,TYPE_local_UN+1) = UN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_UN+1) = UN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_UN_NM+1) = UN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_UN_NM+1) = UN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_VN+1) = VN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_VN+1) = VN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_VN_NM+1) = VN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_VN_NM+1) = VN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,:,TYPE_local_NE+1) = NE(:,:,:) + endif ! (.not. only_neutral_density) + + if (include_vTEC) then + var%vars_2d(:,:,TYPE_local_2D_TEC+1) = vTEC + endif ! (include_vTEC) + +end subroutine read_TIEGCM_restart + + + +subroutine read_TIEGCM_definition(file_name) +!======================================================================= +! +! Read TIEGCM grid definition and Geopotential from a tiegcm restart file +! + + character (len = *), intent(in) :: file_name + integer :: ncerr + integer :: restart_id + integer :: var_lon_id, var_lat_id, var_lev_id, var_ilev_id + integer :: dim_lon_id, dim_lat_id, dim_lev_id, dim_ilev_id + integer :: dim_id, dim_len, var_mtime_id + integer :: dim_time_id, dim_time_len, missing_value_len + integer :: var_p0_id + integer :: l + real(r8) :: p0, lon_tmp + integer, dimension(:,:), allocatable :: mtimetmp + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: utsec, doy + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_definition:reading restart:', file_name + ncerr = nf90_open(file_name, NF90_NOWRITE, restart_id) + call nc_check(ncerr, 'read_TIEGCM_definition', 'open') + if (do_output()) print *, 'read_TIEGCM_definition:opened with '//trim(nf90_strerror(ncerr)) + + call nc_check(nf90_inq_dimid(restart_id, 'lon', dim_lon_id), & + 'read_TIEGCM_definition', 'inq_dimid lon') + call nc_check(nf90_inquire_dimension(restart_id, dim_lon_id, len=nlon), & + 'read_TIEGCM_definition', 'inquire_dimension lon') + allocate(lons(nlon)) + call nc_check(nf90_inq_varid(restart_id, 'lon', var_lon_id), & + 'read_TIEGCM_definition', 'inq_varid lon') + call nc_check(nf90_get_var(restart_id, var_lon_id, values=lons), & + 'read_TIEGCM_definition', 'get_var lon') + + do l = 1, nlon + lon_tmp = lons(l) + if (lon_tmp < 0) lons(l) = lons(l) + 360 ! DART [0, 360] TIEGCM [-180, 180] + enddo + + call nc_check(nf90_inq_dimid(restart_id, 'lat', dim_lat_id), & + 'read_TIEGCM_definition', 'inq_dimid lat') + call nc_check(nf90_inquire_dimension(restart_id, dim_lat_id, len=nlat), & + 'read_TIEGCM_definition', 'inquire_dimension lat') + allocate(lats(nlat)) + call nc_check(nf90_inq_varid(restart_id, 'lat', var_lat_id), & + 'read_TIEGCM_definition', 'inq_varid lat') + call nc_check(nf90_get_var(restart_id, var_lat_id, values=lats), & + 'read_TIEGCM_definition', 'get_var lat') + + call nc_check(nf90_inq_varid(restart_id, 'p0', var_p0_id), & + 'read_TIEGCM_definition', 'inq_varid p0') + call nc_check(nf90_get_var(restart_id, var_p0_id, values=p0), & + 'read_TIEGCM_definition', 'get_var p0') + + TIEGCM_reference_pressure = p0 + + call nc_check(nf90_inq_dimid(restart_id, 'lev', dim_lev_id), & + 'read_TIEGCM_definition', 'inq_dimid lev') + call nc_check(nf90_inquire_dimension(restart_id, dim_lev_id, len=nlev), & + 'read_TIEGCM_definition', 'inquire_dimension lev') + allocate(levs(nlev)) + allocate(plevs(nlev)) + call nc_check(nf90_inq_varid(restart_id, 'lev', var_lev_id), & + 'read_TIEGCM_definition', 'inq_varid lev') + call nc_check(nf90_get_var(restart_id, var_lev_id, values=levs), & + 'read_TIEGCM_definition', 'get_var lev') + + plevs = p0 * exp(-levs) * 100.0_r8 ![Pa] = 100* [millibars] = 100* [hPa] + + call nc_check(nf90_inq_dimid(restart_id, 'ilev', dim_ilev_id), & + 'read_TIEGCM_definition', 'inq_dimid ilev') + call nc_check(nf90_inquire_dimension(restart_id, dim_ilev_id, len=nilev), & + 'read_TIEGCM_definition', 'inquire_dimension ilev') + allocate(ilevs(nilev)) + allocate(pilevs(nilev)) + call nc_check(nf90_inq_varid(restart_id, 'ilev', var_ilev_id), & + 'read_TIEGCM_definition', 'inq_varid ilev') + call nc_check(nf90_get_var(restart_id, var_ilev_id, values=ilevs), & + 'read_TIEGCM_definition', 'get_var ilev') + + pilevs = p0 * exp(-ilevs) * 100.0_r8 ! [Pa] = 100* [millibars] = 100* [hPa] + + if (nlev .ne. nilev) then + write(msgstring, *) ' nlev = ',nlev,' nilev = ',nilev, 'are different; DART assumes them to be the same' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire_attribute(restart_id, nf90_global, 'missing_value', len = missing_value_len), & + 'read_TIEGCM_definition', 'inquire global attribute named missing_value') + if (missing_value_len .ne. 1) then + write(msgstring, *) ' global attribute missing_value length is ', missing_value_len, ' DART expects 1' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_get_att(restart_id, nf90_global, 'missing_value', TIEGCM_missing_value), & + 'read_TIEGCM_definition', 'get_att global attribute named missing_value') + +!... get mtime + call nc_check(nf90_inq_dimid(restart_id, 'mtimedim', dim_id), & + 'read_TIEGCM_definition', 'inq_dimid mtimedim') + call nc_check(nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_definition', 'inquire_dimension mtimedim') + if (dim_len .ne. nmtime) then + write(msgstring, *) trim(file_name), ' mtimedim = ',dim_len, ' DART expects ', nmtime + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_definition', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_definition', 'inquire_dimension time') + + allocate(mtimetmp(dim_len, dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'mtime', var_mtime_id), & + 'read_TIEGCM_definition', 'inq_varid mtime') + call nc_check(nf90_get_var(restart_id, var_mtime_id, values=mtimetmp), & + 'read_TIEGCM_definition', 'get_var mtime') + mtime = mtimetmp(:,dim_time_len) + deallocate(mtimetmp) + + call nc_check(nf90_close(restart_id),'read_TIEGCM_definition', 'close') + + if (do_output()) print *, 'read_TIEGCM_definition: mtime (doy/hour/minute):', mtime + doy = mtime(1) + utsec = (mtime(2)*60 + mtime(3))*60 + +end subroutine read_TIEGCM_definition + + + +subroutine read_TIEGCM_secondary(file_name, var) +!======================================================================= +! +! Read TIEGCM Geopotential from a tiegcm secondary output file +! + + character (len = *), intent(in):: file_name + type(model_type), intent(out):: var + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_ZGtmp_id + real(r8), dimension(nlon,nlat,nilev) :: ZG + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_secondary:reading restart:', file_name + + call nc_check(nf90_open(file_name, NF90_NOWRITE, restart_id), & + 'read_TIEGCM_secondary', 'open') + +!... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_secondary', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_secondary', 'inquire_dimension time') + + call nc_check(nf90_inq_varid(restart_id, 'ZG', var_ZGtmp_id), & + 'read_TIEGCM_secondary', 'inq_varid ZG') + call nc_check(nf90_get_var(restart_id, var_ZGtmp_id, values=ZG, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_secondary', 'get_var ZG') + + call nc_check(nf90_close(restart_id),'read_TIEGCM_secondary', 'close') + + var%vars_3d(:,:,:,TYPE_local_ZG+1) = ZG(:,:,:) ![cm] + +end subroutine read_TIEGCM_secondary + + +subroutine read_TIEGCM_namelist(file_name,var) +!======================================================================= +! +! Read in TIEGCM namelist input +! + character (len = *), intent(in) :: file_name + type(model_type), optional, intent(out) :: var + integer :: iunit, io + integer :: daysec = 86400 + +!---------------------------------------------------------------------------------- +! 1/3/2011, the namelist definition taken from $TGCMROOT/tiegcm1.93/src/input.F +! the following parameter values are from params.F +! modify the namelist definition for future tiegcm updates +! + integer,parameter :: mxind_time = 500 ! max number of time-dependent solar index points + integer,parameter :: mxhvols = 100 ! max number of output history file + integer,parameter :: mxseries = 10 ! max number of time series for primary histories + integer,parameter :: mxfsech = 100 ! max number of fields on secondary histories +! +! Namelist user input variables: +! + character(len=80)::& + & label, &! optional generic text label for this run + & tempdir, &! temporary directory + & magvol, &! file name or mss path to magnetic data file + & amievol ! file or mss path of amie data file (optional) +! +! date and calday are no longer supported, and are replaced by start_day, +! start_year, and calendar_advance. Date and calday are retained here so +! error usage statements can be issued if user sets one of them. +! + integer :: & + & start_day, &! starting day of year (integer 0->365) + & start_year, &! starting year (4-digit integer yyyy) + & calendar_advance,&! if > 0, advance calendar day from start_day + & date(3), &! old: model starting year, day ( 2 ints yyyy,dd) + & calday, &! old: starting calendar day (0-mxday) + & mxday, &! calendar day (0-mxday) + & step, &! model time step (integer seconds) + & dispose, &! dispose output files to mss if dispose==1 or 2 + & eddy_dif, &! 0/1 flag for DOY dependent eddy diffusion (difk, dift, xmue) + & dynamo, &! 0/1 flag for dynamo + & tideann, &! 0/1 flag for annual tide (deprecated as of May 2008) + & aurora, &! 0/1 flag for aurora + & ntask_lat, &! number of tasks in latitude dimension + & ntask_lon ! number of tasks in longitude dimension + real :: & + & tide(10), &! semidiurnal tide amplitudes and phases + & tide2(2), &! diurnal tide amplitude and phase + & tide3m3(2), &! 2-day wave amplitude and phase + & f107, &! 10.7 cm daily solar flux + & f107a, &! 10.7 cm average (81-day) solar flux + & colfac ! collision factor +! +! Input parameters that can be either constant or time-dependent: + real :: & + & power, &! hemispheric power (gw) (hpower on histories) + & ctpoten, &! cross-cap potential (volts) + & bximf, &! BX component of IMF + & byimf, &! BY component of IMF + & bzimf, &! BZ component of IMF in nT + & swvel, &! Solar wind velocity in km/s + & swden, &! Solar wind density in #/cm3 + & al, &! AL lower magnetic auroral activity index in nT + & kp ! Kp index + real,dimension(4,mxind_time) :: power_time,ctpoten_time, & + & bximf_time,byimf_time,bzimf_time,swvel_time,swden_time,al_time, & + & kp_time + integer :: & + & ntimes_ctpoten,ntimes_power,ntimes_bximf,ntimes_byimf, & + & ntimes_bzimf,ntimes_swden,ntimes_swvel,ntimes_al,ntimes_kp + logical :: aluse ! logical to use AL in Weimer 2001 model or not +! +! Parameters as read from namelist: + real :: rd_power,rd_ctpoten,rd_f107,rd_f107a,rd_bximf,rd_byimf, & + & rd_bzimf,rd_swvel,rd_swden,rd_kp +! +! If indices_interp==1, time-dependent indices (power_time, ctpoten_time, etc) +! will be interpolated to model time, otherwise they will change only +! when the given values change. This has no effect on indices given as constants. +! + integer :: indices_interp=1 +! +! Import data file names: +! + integer,parameter :: mxlen_filename=80 + character(len=mxlen_filename) :: & +! +! 4/2/08 btf: Introducing Weimer 2005 model (wei05sc.F). +! Retain ability to call either the 2001 or 2005 weimer models +! for now, to facilitate comparison runs, so potential_model +! can be either WEIMER01 or WEIMER05. +! + & potential_model, &! electric potential model used + ! Values can be 'HEELIS', 'WEIMER', or 'NONE' + ! If absent, the default value is set to 'HEELIS' + & weimer_ncfile, &! path to netcdf weimer01 coefficients file + & wei05sc_ncfile, &! path to netcdf data files for weimer05 model + & gpi_ncfile, &! mss path or file path to netcdf gpi data file + & ncep_ncfile, &! ncep data file (time-gcm only) + & see_ncfile, &! mss path or file path to netcdf SEE flux data file + & imf_ncfile, &! mss path or disk file path to netcdf IMF data file + & gswm_mi_di_ncfile, &! gswm migrating diurnal data file + & gswm_mi_sdi_ncfile,&! gswm migrating semi-diurnal data file + & gswm_nm_di_ncfile, &! gswm non-migrating diurnal data file + & gswm_nm_sdi_ncfile,&! gswm non-migrating semi-diurnal data file + & saber_ncfile, &! SABER data (T,Z) + & tidi_ncfile ! TIDI data (U,V) +! +! integer,parameter :: ngpivars = 4 +! real :: gpi_vars(ngpivars) ! f107,f107a,power,ctpoten +! character(len=16) :: +! | gpi_names(ngpivars) ! names of gpi_vars +! +! Primary history user input (dimension parameters are in params.h): + character(len=80) :: & + & source, &! file containing source history (optional) + output(mxhvols) ! output file(s) (required) + integer :: & + & source_start(3), &! source history model time + & start(3,mxseries), &! primary history model start time(s) + & stop(3,mxseries), &! primary history model stop time(s) + & hist(3,mxseries), &! primary history disk write frequency + & save(3,mxseries), &! primary history file save frequency + & mxhist_prim, &! max number of histories per primary file + & msreten, &! retention period for history files + & noutput ! number of output files given +! +! Secondary history user input (dimension parameters are in params.h): + character(len=80) :: & + & secsource, &! file containing source sec_history (for mhd) + & secout(mxhvols) ! secondary history output file(s) + character(len=16) :: & + & secflds(mxfsech) ! secondary history output fields + integer :: & + & secstart(3,mxseries),&! secondary history model start time(s) + & secstop(3,mxseries), &! secondary history model stop time(s) + & sechist(3,mxseries), &! secondary history disk write frequency + & secsave(3,mxseries), &! secondary history file save frequency + & mxhist_sech, &! max number of histories per secondary file + & sech_nbyte ! 4 or 8: write real or double values to secondary file +! +! Namelist for read: + namelist/tgcm_input/ & + & label,tempdir,magvol,amievol,date,calday,step,dispose, & + & source,source_start,output,start,stop,hist,save, & + & secout,secstart,secstop,sechist,secsave,secflds, & + & potential_model,eddy_dif,dynamo,tide,tide2,tide3m3, & + & f107,f107a,power,ctpoten,bximf,byimf,bzimf,swvel,swden,al,& + & kp,colfac,tideann,aurora,gpi_ncfile,gswm_mi_di_ncfile, & + & gswm_mi_sdi_ncfile,gswm_nm_di_ncfile,gswm_nm_sdi_ncfile, & + & mxhist_prim,mxhist_sech,msreten,ntask_lat,ntask_lon, & + & start_day,start_year,calendar_advance,see_ncfile, & + & ctpoten_time,power_time,bximf_time,byimf_time,bzimf_time, & + & kp_time,al_time,swden_time,swvel_time,indices_interp, & + & imf_ncfile,saber_ncfile,tidi_ncfile,sech_nbyte + +!---------------------------------------------------------------------------------- + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_namelist',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_namelist: reading restart:', file_name + +!! Read the namelist entry tgcm_input from tiegcm.nml + call find_namelist_in_file("tiegcm.nml", "tgcm_input", iunit) + read(iunit, nml = tgcm_input, iostat = io) + call check_namelist_read(iunit, io, "tgcm_input") + + if (step >= daysec) then + time_step_days = int(step/daysec) + time_step_seconds = mod(step,daysec) + else + time_step_days = 0 + time_step_seconds = step + endif + + if ((state_num_1d > 0) .and. present(var)) then + var%vars_1d(1) = f107 ! f10.7 cm flux + endif + + +end subroutine read_TIEGCM_namelist + + + +subroutine ens_mean_for_model(filter_ens_mean) +!=================================================================== +! +! Not used in low-order models +! Stores provided ensemble mean within the module for later use + +real(r8), intent(in) :: filter_ens_mean(:) + +if ( .not. module_initialized ) call static_init_model + +ens_mean = filter_ens_mean + +end subroutine ens_mean_for_model + + + +subroutine get_close_obs(gc, base_obs_loc, base_obs_kind, obs_loc, obs_kind, & + num_close, close_ind, dist) +!=================================================================== +! +! Given a DART ob (referred to as "base") and a set of obs priors or +! state variables returns the subset of close ones to the "base" ob, their +! indices, and their distances to the "base" ob... + +! For vertical distance computations, general philosophy is to convert all +! vertical coordinates to a common coordinate. +! FOR NOW VERTICAL LOCALIZATION IS DONE ONLY IN HEIGHT (ZG) +! OBS VERTICAL LOCATION IS GIVEN IN HEIGHT (model_interpolate) +! STATE VERTICAL LOCATION IS GIVEN IN HEIGHT (get_state_meta_data) + +! Note that both base_obs_loc and obs_loc are intent(inout), meaning that these +! locations are possibly modified here and returned as such to the calling +! routine. The calling routine is always filter_assim and these arrays are local +! arrays within filter_assim. In other words, these modifications will only +! matter within filter_assim, but will not propagate backwards to filter. + +type(get_close_type), intent(in) :: gc +type(location_type), intent(inout) :: base_obs_loc, obs_loc(:) +integer, intent(in) :: base_obs_kind, obs_kind(:) +integer, intent(out) :: num_close, close_ind(:) +real(r8), intent(out) :: dist(:) + +integer :: k, t_ind + +call loc_get_close_obs(gc, base_obs_loc, base_obs_kind, obs_loc, obs_kind, & + num_close, close_ind, dist) + +if (state_num_1d > 0) then + +do k = 1, num_close + + t_ind = close_ind(k) + !set distance to a very large value so that it won't get updated + + if (obs_kind(t_ind) == KIND_1D_PARAMETER) then + + if (estimate_parameter) then + dist(k) = dist(k)*0.25_r8 + else !not estimate_parameter + dist(k) = 2.0_r8 * PI + endif + + endif + +enddo ! loop over k = 1, num_close + +endif + +end subroutine get_close_obs + + + +!=================================================================== +! End of model_mod +!=================================================================== +end module model_mod + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ + diff --git a/models/tiegcm/model_mod.f90 b/models/tiegcm/model_mod.f90 index c302d07505..08c0e2c6dc 100644 --- a/models/tiegcm/model_mod.f90 +++ b/models/tiegcm/model_mod.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module model_mod @@ -40,11 +38,14 @@ module model_mod KIND_TEMPERATURE, &! neutral temperature obs KIND_PRESSURE, &! neutral pressure obs KIND_MOLEC_OXYGEN_MIXING_RATIO, &! neutral composition obs + KIND_ATOMIC_OXYGEN_MIXING_RATIO, &! added in case needed KIND_1D_PARAMETER, & KIND_GEOPOTENTIAL_HEIGHT, & KIND_GEOMETRIC_HEIGHT, & KIND_VERTICAL_TEC, &! total electron content - get_raw_obs_kind_index, get_raw_obs_kind_name + KIND_ELECTRON_DENSITY, & + get_raw_obs_kind_index, & + get_raw_obs_kind_name use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian @@ -81,10 +82,9 @@ module model_mod test_interpolate ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - '$URL$' -character(len=32 ), parameter :: revision = '$Revision$' -character(len=128), parameter :: revdate = '$Date$' +character(len=*), parameter :: source = 'tiegcm/model_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !------------------------------------------------------------------------------- ! namelist with default values @@ -146,7 +146,6 @@ module model_mod integer :: nilev, nlev, nlon, nlat real(r8),dimension(:), allocatable :: lons, lats, levs, ilevs, plevs, pilevs -real(r8) :: TIEGCM_missing_value !! global attribute real(r8) :: TIEGCM_reference_pressure integer :: time_step_seconds integer :: time_step_days @@ -162,10 +161,6 @@ module model_mod character(len=obstypelength) :: variable_table(max_num_variables, max_num_columns) -! include_vTEC = .true. vTEC must be calculated from other vars -! include_vTEC = .false. just ignore vTEC altogether - -logical :: include_vTEC = .true. logical :: include_vTEC_in_state = .false. ! IMPORTANT: 1 D model parameters (e.g., F107) are read in from "tiegcm.nml" @@ -1767,7 +1762,17 @@ subroutine test_interpolate(x, locarray) call model_interpolate(x, location, KIND_PRESSURE, obs_val, istatus) write(*,*)'test_interpolate: PRESSURE value at ',locarray, & - ' is ',obs_val,' status is ',istatus,' (0 is good)' + ' is ',obs_val,' status is ',istatus,' (0 is good)' + +call model_interpolate(x, location, KIND_TEMPERATURE, obs_val, istatus) + +write(*,*)'test_interpolate: TEMPERATURE value at ',locarray, & + ' is ',obs_val,' status is ',istatus,' (0 is good)' + +call model_interpolate(x, location, KIND_ELECTRON_DENSITY, obs_val, istatus) + +write(*,*)'test_interpolate: ELECTRON DENSITY value at ',locarray, & + ' is ',obs_val,' status is ',istatus,' (0 is good)' call model_interpolate(x, location, KIND_VERTICAL_TEC, obs_val, istatus) @@ -1835,6 +1840,11 @@ subroutine read_TIEGCM_namelist(file_name) & f107a = MISSING_R4, &! 10.7 cm average (81-day) solar flux & colfac, &! collision factor & amie_ibkg ! AMIE_IBKG (not sure...) + ! Add TIE-GCM 2.0 inputs + integer :: & + & current_pg, &! current due to plasma pressure gradient + & current_kq, &! height integrated current density + & calc_helium ! switch for calculation of Helium ! ! Input parameters that can be either constant or time-dependent: real :: & @@ -1941,7 +1951,8 @@ subroutine read_TIEGCM_namelist(file_name) & ctpoten_time,power_time,bximf_time,byimf_time,bzimf_time, & & kp_time,al_time,swden_time,swvel_time,indices_interp, & & imf_ncfile,saber_ncfile,tidi_ncfile,sech_nbyte, amie_ibkg, & - & seeflux, amienh, amiesh + & seeflux, amienh, amiesh, & + & current_pg,current_kq,calc_helium ! Add TIE-GCM 2.0 inputs !------------------------------------------------------------------------------- @@ -2110,7 +2121,7 @@ subroutine read_TIEGCM_secondary(file_name) integer :: ncid integer :: TimeDimID, time_dimlen, VarID -real(r8) :: spvalR8, spvalR4 +real(r8) :: spvalR8 if( .not. file_exist(file_name)) then write(string1,*) trim(file_name),' not available.' @@ -3955,8 +3966,3 @@ end subroutine apply_attributes_4D !=============================================================================== end module model_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/models/tiegcm/model_mod.html b/models/tiegcm/model_mod.html index 278a214428..be75dc22a5 100644 --- a/models/tiegcm/model_mod.html +++ b/models/tiegcm/model_mod.html @@ -138,7 +138,26 @@

Quickstart guide to running

  • Steps 1-5 are repeated until the input DART observation sequence file - + +

    Observation types and their converter programs:

    +
      +
    1. CHAMP_NEUTRAL_DENSITY ... +
      • CHAMP/CHAMP_density_text_to_obs.f90
      +
    2. + +
    3. SSUSI_O_N2_RATIO +
      • SSUSI/convert_f16_edr_dsk.f90
      +
    4. + +
    5. GND_GPS_VTEC +
      • gnd_gps_vtec/gnd_gps_vtec_text_to_obs.f90
      +
    6. + +
    7. SAT_RHO +
      • text_GITM/text_to_obs.f90
      +
    8. +
    +

    What to check when things go wrong.

    The scripts are designed to send email to the user that contains the run-time output from the script. Check that first. If that does not provide the @@ -1144,7 +1163,7 @@

    FILES

    tiegcm_restart_p.nc both read and modified by the TIEGCM model_mod tiegcm_s.nc - read by the GCOM model_mod for metadata purposes. + read by the TIEGCM model_mod for metadata purposes. namelist_update DART file containing information useful for starting and stopping TIEGCM. advance_model.csh uses this to update the @@ -1214,9 +1233,11 @@

    REFERENCES


  • -
  • Chartier, A., T. Matsuo, J. L. Anderson, G. Lu, T. Hoar, N. Collins, A. Coster, C. Mitchell, L. Paxton, G. Bust (2015),
    -Ionospheric Data Assimilation and Forecasting During Storms,
    -Journal of Geophysical Research, under review
  • +
  • Chartier, A., T. Matsuo, J. L. Anderson, G. Lu, T. Hoar, N. Collins, A. Coster, C. Mitchell, L. Paxton, G. Bust (2016),
    +Ionospheric Data Assimilation and Forecasting During Storms.
    +Journal of Geophysical Research: Space Physics, 121, 764-778, +10.1002/2014JA020799 +
  • diff --git a/models/tiegcm/model_mod.ite.f90 b/models/tiegcm/model_mod.ite.f90 new file mode 100644 index 0000000000..03f7726f34 --- /dev/null +++ b/models/tiegcm/model_mod.ite.f90 @@ -0,0 +1,2493 @@ +! DART software - Copyright © 2004 - 2010 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download + +module model_mod + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ +!------------------------------------------------------------------ +! +! Interface for HAO-TIEGCM +! +!------------------------------------------------------------------ +! DART Modules +use types_mod, only : r8, digits12, missing_r8, i4, PI +use time_manager_mod, only : time_type, set_calendar_type, set_time_missing, & + set_time, get_time, print_time, & + set_date, get_date, print_date, & + operator(*), operator(+), operator(-), & + operator(>), operator(<), operator(/), & + operator(/=), operator(<=) +use location_mod, only : location_type, get_close_maxdist_init, & + get_close_obs_init, loc_get_close_obs => get_close_obs,& + set_location, get_location, query_location, & + get_dist, vert_is_height, horiz_dist_only, & + get_close_type, & + VERTISPRESSURE, VERTISHEIGHT, vert_is_pressure +use utilities_mod, only : file_exist, open_file, close_file, & + error_handler, E_ERR, E_MSG, E_WARN, nmlfileunit, & + do_output, find_namelist_in_file, check_namelist_read, & + do_nml_file, do_nml_term, nc_check, & + register_module +use obs_kind_mod, only : KIND_U_WIND_COMPONENT, &! just for definition + KIND_V_WIND_COMPONENT, &! just for definition + KIND_TEMPERATURE, &! neutral density obs + KIND_PRESSURE, &! neutral density obs + KIND_ELECTRON_DENSITY, &! Ne obs + KIND_ATOMIC_OXYGEN_MIXING_RATIO, &! neutral density obs + KIND_MOLEC_OXYGEN_MIXING_RATIO, &! neutral density obs + KIND_1D_PARAMETER, &! just for definition + KIND_GEOPOTENTIAL_HEIGHT +use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian +use mpi_utilities_mod,only : my_task_id +use typesizes +use netcdf + +implicit none +private + +public :: get_model_size, & + adv_1step, & + get_state_meta_data, & + model_interpolate, & + get_model_time_step, & + end_model, & + static_init_model, & + init_time, & + init_conditions, & + nc_write_model_atts, & + nc_write_model_vars, & + pert_model_state, & + get_close_maxdist_init, & + get_close_obs_init, & + get_close_obs, & + ens_mean_for_model +!TIEGCM specific routines +public :: model_type, & + init_model_instance, & + end_model_instance, & + prog_var_to_vector, & + vector_to_prog_var, & + read_TIEGCM_restart, & + update_TIEGCM_restart, & + read_TIEGCM_definition, & + read_TIEGCM_secondary, & + read_TIEGCM_namelist + +! version controlled file description for error handling, do not edit +character(len=128), parameter :: & + source = "$URL$", & + revision = "$Revision$", & + revdate = "$Date$" + +!------------------------------------------------------------------ +! define model parameters + +integer :: nilev, nlev, nlon, nlat +real(r8),dimension(:), allocatable :: lons, lats, levs, ilevs, plevs, pilevs +real(r8) :: TIEGCM_missing_value !! global attribute +real(r8) :: TIEGCM_reference_pressure +integer :: time_step_seconds +integer :: time_step_days +type(time_type) :: time_step + + ! IMPORTANT: Change output file names in + ! tiegcm.nml to match with the names below + ! i.e. OUTPUT='tiegcm_restart_p.nc' + ! SECOUT='tiegcm_s.nc' +character (len=19) :: restart_file = 'tiegcm_restart_p.nc' +character (len=11) :: secondary_file = 'tiegcm_s.nc' +character (len=10) :: namelist_file = 'tiegcm.nml' + + ! 3d TIEGCM variables are packed into + ! DART state vector in the following order +integer, parameter :: TYPE_local_ZG = 0 +integer, parameter :: TYPE_local_TN = 1 +integer, parameter :: TYPE_local_TN_NM = 2 +integer, parameter :: TYPE_local_O1 = 3 +integer, parameter :: TYPE_local_O1_NM = 4 +integer, parameter :: TYPE_local_O2 = 5 +integer, parameter :: TYPE_local_O2_NM = 6 +integer, parameter :: TYPE_local_UN = 7 +integer, parameter :: TYPE_local_UN_NM = 8 +integer, parameter :: TYPE_local_VN = 9 +integer, parameter :: TYPE_local_VN_NM = 10 +integer, parameter :: TYPE_local_NE = 11 + +type model_type + real(r8), pointer :: vars_3d(:,:,:,:) + real(r8), pointer :: vars_1d(:) + type(time_type) :: valid_time +end type model_type + +logical :: only_neutral_density = .false. + ! .true. excludes UN VN NE (state_num_3d = 7) + ! .false. includes UN VN NE (state_num_3d = 12) +integer :: state_num_3d = 12 + ! -- interface levels -- + ! NE ZG + ! -- midpoint levels -- + ! O1 O1_NM O2 O2_NM + ! -- midpoint levels; top slot missing -- + ! TN TN_NM UN UN_NM VN VN_NM + +integer :: state_num_1d = 0 +logical :: estimate_parameter = .false. + ! IMPORTANT: 1 D model parameters (e.g., F107) are read in from "tiegcm.nml" + ! When "estimate_parameter = .true.", "state_num_1d" should be greater than or + ! equal to 1 so that 1 D model parameters will be included in the state vector + ! (note "estimate_parameter" option is still under + ! development by Tomoko Matsuo as of June 24, 2011) + +integer :: model_size +real(r8), allocatable :: ens_mean(:) + + ! FOR NOW OBS LOCATIONS ARE EXPECTED GIVEN IN HEIGHT [m], + ! AND SO VERTICAL LOCALIZATION COORDINATE IS *always* HEIGHT + ! (note that gravity adjusted geopotential height (ZG) + ! read in from "tiegcm_s.nc") +!integer :: vert_localization_coord = VERTISHEIGHT + +namelist /model_nml/ output_state_vector, state_num_3d, state_num_1d + +logical :: output_state_vector = .false. + ! .true. results in a "state-vector" netCDF file + ! .false. results in a "prognostic-var" netCDF file +logical :: first_pert_call = .true. +type(random_seq_type) :: random_seq +!------------------------------------------------------------------ + +character(len = 129) :: msgstring +logical, save :: module_initialized = .false. + +contains + +!================================================================== + + +subroutine static_init_model() +!------------------------------------------------------------------ +! +! Called to do one time initialization of the model. As examples, +! might define information about the model size or model timestep. +! In models that require pre-computed static data, for instance +! spherical harmonic weights, these would also be computed here. +! Can be a NULL INTERFACE for the simplest models. + + integer :: i + integer :: iunit, io + +if (module_initialized) return ! only need to do this once + +! Print module information to log file and stdout. +call register_module(source, revision, revdate) + +! Since this routine calls other routines that could call this routine +! we'll say we've been initialized pretty dang early. +module_initialized = .true. + +!! Read the namelist entry for model_mod from input.nml +!call find_namelist_in_file("input.nml", "model_nml", iunit) +!read(iunit, nml = model_nml, iostat = io) +!call check_namelist_read(iunit, io, "model_nml") + +!if (do_nml_file()) write(nmlfileunit, nml=model_nml) +!if (do_nml_term()) write( * , nml=model_nml) + +! Reading in TIEGCM grid definition etc from TIEGCM restart file +call read_TIEGCM_definition(restart_file) + +! Reading in TIEGCM namelist input file (just for definition) +call read_TIEGCM_namelist(namelist_file) + +! Compute overall model size +model_size = nlon * nlat * nlev * state_num_3d + state_num_1d + +if (do_output()) write(*,*) 'nlon = ', nlon +if (do_output()) write(*,*) 'nlat = ', nlat +if (do_output()) write(*,*) 'nlev = ', nlev +if (do_output()) write(*,*) 'n3D = ', state_num_3d +if (do_output()) write(*,*) 'n1D = ', state_num_1d +if (do_output()) write(*,*) 'model_size = ', model_size + +allocate (ens_mean(model_size)) + +! Might as well use the Gregorian Calendar +call set_calendar_type('Gregorian') + +! The time_step in terms of a time type must also be initialized. +time_step = set_time(time_step_seconds, time_step_days) + +end subroutine static_init_model + + + +subroutine init_conditions(x) +!------------------------------------------------------------------ +! subroutine init_conditions(x) +! +! Returns a model state vector, x, that is some sort of appropriate +! initial condition for starting up a long integration of the model. +! At present, this is only used if the namelist parameter +! start_from_restart is set to .false. in the program perfect_model_obs. +! If this option is not to be used in perfect_model_obs, or if no +! synthetic data experiments using perfect_model_obs are planned, +! this can be a NULL INTERFACE. + +real(r8), intent(out) :: x(:) + +if ( .not. module_initialized ) call static_init_model + +end subroutine init_conditions + + + +subroutine adv_1step(x, time) +!------------------------------------------------------------------ +! subroutine adv_1step(x, time) +! +! Does a single timestep advance of the model. The input value of +! the vector x is the starting condition and x is updated to reflect +! the changed state after a timestep. The time argument is intent +! in and is used for models that need to know the date/time to +! compute a timestep, for instance for radiation computations. +! This interface is only called if the namelist parameter +! async is set to 0 in perfect_model_obs of filter or if the +! program integrate_model is to be used to advance the model +! state as a separate executable. If one of these options +! is not going to be used (the model will only be advanced as +! a separate model-specific executable), this can be a +! NULL INTERFACE. + +real(r8), intent(inout) :: x(:) +type(time_type), intent(in) :: time + +end subroutine adv_1step + + + +function get_model_size() +!------------------------------------------------------------------ +! +! Returns the size of the model as an integer. Required for all +! applications. + +integer :: get_model_size + +if ( .not. module_initialized ) call static_init_model + +get_model_size = model_size + +end function get_model_size + + + +subroutine init_time(time) +!------------------------------------------------------------------ +! +! Companion interface to init_conditions. Returns a time that is somehow +! appropriate for starting up a long integration of the model. +! At present, this is only used if the namelist parameter +! start_from_restart is set to .false. in the program perfect_model_obs. +! If this option is not to be used in perfect_model_obs, or if no +! synthetic data experiments using perfect_model_obs are planned, +! this can be a NULL INTERFACE. + +type(time_type), intent(out) :: time + +if ( .not. module_initialized ) call static_init_model + +! for now, just set to 0 +time = set_time(0,0) + +end subroutine init_time + + + +subroutine model_interpolate(x, location, itype, obs_val, istatus) +!------------------------------------------------------------------ +! +! Given a state vector, a location, and a model state variable type, +! interpolates the state variable field to that location and returns +! the value in obs_val. The istatus variable should be returned as +! 0 unless there is some problem in computing the interpolation in +! which case an alternate value should be returned. The itype variable +! is a model specific integer that specifies the type of field (for +! instance temperature, zonal wind component, etc.). In low order +! models that have no notion of types of variables, this argument can +! be ignored. For applications in which only perfect model experiments +! with identity observations (i.e. only the value of a particular +! state variable is observed), this can be a NULL INTERFACE. + +real(r8), intent(in) :: x(:) +type(location_type), intent(in) :: location +integer, intent(in) :: itype +real(r8), intent(out) :: obs_val +integer, intent(out) :: istatus + +integer :: i, vstatus, which_vert +integer :: lat_below, lat_above, lon_below, lon_above +integer :: zero_lon_index +real(r8) :: lon_fract, temp_lon, lat_fract +real(r8) :: lon, lat, height, lon_lat_lev(3) +real(r8) :: bot_lon, top_lon, delta_lon, bot_lat, top_lat, delta_lat +real(r8) :: val(2,2), a(2) + +if ( .not. module_initialized ) call static_init_model + + +! Default for successful return +istatus = 0 +vstatus = 0 + +! Get the position +! FOR NOW OBS VERTICAL LOCATION IS ALWAYS HEIGHT +lon_lat_lev = get_location(location) +lon = lon_lat_lev(1) ! degree +lat = lon_lat_lev(2) ! degree +if(vert_is_height(location)) then + height = lon_lat_lev(3) +else + which_vert = nint(query_location(location)) + write(msgstring,*) 'vertical coordinate type:',which_vert,' cannot be handled' + call error_handler(E_ERR,'model_interpolate',msgstring,source,revision,revdate) +endif + +! Get lon and lat grid specs +bot_lon = lons(1) ! 180. +delta_lon = abs((lons(1)-lons(2))) ! 5. or 2.5 +zero_lon_index = int(bot_lon/delta_lon) + 1 ! 37 or 73 +top_lon = lons(nlon) ! 175. or 177.5 +bot_lat = lats(1) ! +top_lat = lats(nlat) ! +delta_lat = abs((lats(1)-lats(2))) ! + + +! Compute bracketing lon indices: +! TIEGCM [-180 175] DART [180, 185, ..., 355, 0, 5, ..., 175] +if(lon > top_lon .and. lon < bot_lon) then ! at wraparound point [175 < lon < 180] + lon_below = nlon + lon_above = 1 + lon_fract = (lon - top_lon) / delta_lon +else if (lon >= bot_lon) then ! [180 <= lon <= 360] + lon_below = int((lon - bot_lon) / delta_lon) + 1 + lon_above = lon_below + 1 + lon_fract = (lon - lons(lon_below)) / delta_lon +else ! [0 <= lon <= 175 ] + lon_below = int((lon - 0.0_r8) / delta_lon) + zero_lon_index + lon_above = lon_below + 1 + lon_fract = (lon - lons(lon_below)) / delta_lon +endif + +! Compute neighboring lat rows: TIEGCM [-87.5, 87.5] DART [-90, 90] +! NEED TO BE VERY CAREFUL ABOUT POLES; WHAT'S BEING DONE IS NOT GREAT! +if(lat >= bot_lat .and. lat <= top_lat) then ! -87.5 <= lat <= 87.5 + lat_below = int((lat - bot_lat) / delta_lat) + 1 + lat_above = lat_below + 1 + lat_fract = (lat - lats(lat_below) ) / delta_lat +else if(lat < bot_lat) then ! South of bottom lat + lat_below = 1 + lat_above = 1 + lat_fract = 1.0_r8 +else ! North of top lat + lat_below = nlat + lat_above = nlat + lat_fract = 1.0_r8 +endif + +! Now, need to find the values for the four corners + call get_val(val(1, 1), x, lon_below, lat_below, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(1, 2), x, lon_below, lat_above, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(2, 1), x, lon_above, lat_below, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(2, 2), x, lon_above, lat_above, height, itype, vstatus) + + +! istatus meaning return expected obs? assimilate? +! 0 obs and model are fine; yes yes +! 1 fatal problem; no no +! 2 exclude valid obs yes no +! +istatus = vstatus +if(istatus /= 1) then + do i = 1, 2 + a(i) = lon_fract * val(2, i) + (1.0_r8 - lon_fract) * val(1, i) + end do + obs_val = lat_fract * a(2) + (1.0_r8 - lat_fract) * a(1) +else + obs_val = missing_r8 +endif + + +end subroutine model_interpolate + + + +subroutine get_val(val, x, lon_index, lat_index, height, obs_kind, istatus) +!------------------------------------------------------------------ +! +real(r8), intent(out) :: val +real(r8), intent(in) :: x(:) +integer, intent(in) :: lon_index, lat_index +real(r8), intent(in) :: height +integer, intent(in) :: obs_kind +integer, intent(out) :: istatus + +integer :: var_type +integer :: k, lev_top, lev_bottom +real(r8) :: zgrid, delta_z, zgrid_top, zgrid_bottom +real(r8) :: val_top, val_bottom, frac_lev + + +! No errors to start with +istatus = 0 + +! To find a layer height: what's the unit of height [m] +! pressure level ln(p0/p) -- interface [-7.0 7.0] and midlevel [-6.75 7.25] +! Ne and ZG are defined at midpoint +! T, U, V, O & O2 are defined at midpoint +! T, U, V at top midlevel pressure level are missing values in TIEGCM +! but filled in DART with the values at nlev -1 +if (obs_kind == KIND_ELECTRON_DENSITY) then + + zgrid_bottom = & + x(get_index(lat_index,lon_index,1,TYPE_local_ZG))/100.0_r8 ![m] = /100 [cm] + zgrid_top = & + x(get_index(lat_index,lon_index,nlev,TYPE_local_ZG))/100.0_r8 + if ((zgrid_bottom > height) .or. (zgrid_top < height)) then + istatus = 1 !obs height is above or below the model boundary + val = 0.0 + return + endif + + h_loop_interface:do k = 2, nlev + + zgrid = x(get_index(lat_index,lon_index,k,TYPE_local_ZG))/100.0_r8 ![m] = /100 [cm] + + if (height <= zgrid) then + lev_top = k + lev_bottom = lev_top -1 + delta_z = zgrid - & + x(get_index(lat_index,lon_index,lev_bottom,TYPE_local_ZG))/100.0_r8 + frac_lev = (zgrid - height)/delta_z + exit h_loop_interface + endif + + enddo h_loop_interface + +else + + !mid_level 1 + zgrid_bottom = 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,1,TYPE_local_ZG)) + & ![m] = /100 [cm] + x(get_index(lat_index,lon_index,2,TYPE_local_ZG))) + + !mid_level nlev-1 + zgrid_top = 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,nlev-1,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,nlev,TYPE_local_ZG))) + + if ((zgrid_bottom > height) .or. (zgrid_top < height)) then + istatus = 1 !obs height is above or below the model boundary + val = 0.0 + return + endif + + h_loop_midpoint:do k = 2, nlev-1 + + zgrid = 0.50_r8 / 100.0_r8 * & ! [m] = ZGtiegcm/100 [cm] + (x(get_index(lat_index,lon_index,k,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,k+1,TYPE_local_ZG))) + + if (height <= zgrid) then + lev_top = k + lev_bottom = lev_top -1 + delta_z = zgrid - 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,lev_bottom,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,lev_bottom+1,TYPE_local_ZG))) + frac_lev = (zgrid - height)/delta_z + exit h_loop_midpoint + endif + + enddo h_loop_midpoint + +endif + + +if (obs_kind == KIND_ATOMIC_OXYGEN_MIXING_RATIO) then + + var_type = TYPE_local_O1 + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_MOLEC_OXYGEN_MIXING_RATIO) then + + var_type = TYPE_local_O2 + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_TEMPERATURE) then + + var_type = TYPE_local_TN + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_PRESSURE) then + + val_top = plevs(lev_top) !pressure at midpoint [Pa] + val_bottom = plevs(lev_bottom) !pressure at midpoint [Pa] + +elseif (obs_kind == KIND_ELECTRON_DENSITY) then + + var_type = TYPE_local_NE + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +else + + istatus = 1 + val = 0. + return + +endif + +if (obs_kind == KIND_PRESSURE) then + val = exp(frac_lev * log(val_bottom) + (1.0 - frac_lev) * log(val_top)) +else +!KIND_ELECTRON_DENSITY +!KIND_TEMPERATURE +!KIND_MOLEC_OXYGEN_MIXING_RATIO +!KIND_ATOMIC_OXYGEN_MIXING_RATIO + val = frac_lev * val_bottom + (1.0 - frac_lev) * val_top +endif + +end subroutine get_val + + + +function get_index(lat_index, lon_index, lev_index, var_type) +!------------------------------------------------------------------ +! +integer, intent(in) :: lat_index, lon_index, lev_index, var_type +integer :: get_index +integer :: initial_3d_index + +initial_3d_index = 1 + +get_index = initial_3d_index & + + var_type + (lev_index -1)*state_num_3d & + + (lat_index -1)*state_num_3d*nlev & + + (lon_index -1)*state_num_3d*nlev*nlat + +end function get_index + + + +function get_model_time_step() +!------------------------------------------------------------------ +! +! Returns the the time step of the model; the smallest increment +! in time that the model is capable of advancing the state in a given +! implementation. This interface is required for all applications. + +type(time_type) :: get_model_time_step + +if ( .not. module_initialized ) call static_init_model + +get_model_time_step = time_step + +end function get_model_time_step + + + +subroutine get_state_meta_data(index_in, location, var_type) +!------------------------------------------------------------------ +! +! Given an integer index into the state vector structure, returns the +! associated location. A second intent(out) optional argument kind +! can be returned if the model has more than one type of field (for +! instance temperature and zonal wind component). This interface is +! required for all filter applications as it is required for computing +! the distance between observations and state variables. + +integer, intent(in) :: index_in +type(location_type), intent(out) :: location +integer, optional, intent(out) :: var_type + +integer :: indx, num_per_col, col_num, col_elem +integer :: lon_index, lat_index, lev_index +real(r8) :: lon, lat, lev, height +integer :: local_var_type, var_type_temp +integer :: model_utsec + +if ( .not. module_initialized ) call static_init_model + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! PARAMETERS DO NOT HAVE LOCATION +if (index_in >= (model_size - state_num_1d + 1)) then + + local_var_type = KIND_1D_PARAMETER + lev = pilevs(22) !return a fake value + height = 400000_r8 !return a fake value + lat = 0.0_r8 !return a fake value + lat = 0.0_r8 !return a fake value + +location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +else + +! Easier to compute with a 0 to size -1 index +indx = index_in -1 + +! Compute number of items per column +num_per_col = nlev * state_num_3d + +! What column is this index in +col_num = indx / num_per_col +col_elem = indx - col_num * num_per_col + +! what lon and lat index for this column +lon_index = col_num /nlat +lat_index = col_num - lon_index * nlat + +! Now figure out which beast in column this is +lev_index = col_elem / state_num_3d + +! Get actual lon lat values from static_init_model arrays +lon = lons(lon_index + 1) +lat = lats(lat_index + 1) + +! Find which var_type this element is +var_type_temp = mod(col_elem, state_num_3d) + +if (var_type_temp == TYPE_local_ZG) then !ZG + local_var_type = KIND_GEOPOTENTIAL_HEIGHT +else if (var_type_temp == TYPE_local_TN) then !TN + local_var_type = KIND_TEMPERATURE +else if (var_type_temp == TYPE_local_TN_NM) then !TN_NM + local_var_type = KIND_TEMPERATURE +else if (var_type_temp == TYPE_local_O1) then !O1 + local_var_type = KIND_ATOMIC_OXYGEN_MIXING_RATIO +else if (var_type_temp == TYPE_local_O1_NM) then !O1_NM + local_var_type = KIND_ATOMIC_OXYGEN_MIXING_RATIO +else if (var_type_temp == TYPE_local_O2) then !O2 + local_var_type = KIND_MOLEC_OXYGEN_MIXING_RATIO +else if (var_type_temp == TYPE_local_O2_NM) then !O2_NM + local_var_type = KIND_MOLEC_OXYGEN_MIXING_RATIO +else if (var_type_temp == TYPE_local_UN) then !UN + local_var_type = KIND_U_WIND_COMPONENT +else if (var_type_temp == TYPE_local_UN_NM) then !UN_NM + local_var_type = KIND_U_WIND_COMPONENT +else if (var_type_temp == TYPE_local_VN) then !VN + local_var_type = KIND_V_WIND_COMPONENT +else if (var_type_temp == TYPE_local_VN_NM) then !VN_NM + local_var_type = KIND_V_WIND_COMPONENT +else if (var_type_temp == TYPE_local_NE) then !NE + local_var_type = KIND_ELECTRON_DENSITY +else + write(msgstring,*)"unknown var_type for index ",index_in + call error_handler(E_ERR,"get_state_meta_data", msgstring, source, revision, revdate) +endif + +!----------------------------------------------------- +!TIEGCM's 'natural' vertical coordinate is pressure +!if ((local_var_type == KIND_ELECTRON_DENSITY) .or. & !NE defined at interface levels +! (local_var_type == KIND_GEOPOTENTIAL_HEIGHT)) then !ZG defined at interface levels +! lev = pilevs(lev_index + 1) +!else !TN UN VN O1 defined at midpoints +! lev = plevs(lev_index + 1) +!endif +!location = set_location(lon,lat,lev,VERTISPRESSURE) !pressure(2),height(3) +!----------------------------------------------------- + +if ((local_var_type == KIND_ELECTRON_DENSITY) .or. & + (local_var_type == KIND_GEOPOTENTIAL_HEIGHT)) then + !NE defined at interface levels + !ZG defined at interface levels + height = ens_mean(get_index(lat_index+1,& + lon_index+1,& + lev_index+1,& + TYPE_local_ZG))/100.0_r8 ![m] = ZGtiegcm/100 [cm] + +else + !TN UN VN O1 defined at midpoints + !TIEGCM: top midpoint slot contains missing values for TN UN VN + if (lev_index+2 > nlev) then + height = ens_mean(get_index(lat_index+1,lon_index+1, & + nlev,TYPE_local_ZG)) / 100.0_r8 + else + height = 0.50_r8 / 100.0_r8 * & + (ens_mean(get_index(lat_index+1,lon_index+1, & + lev_index+1,TYPE_local_ZG)) + & + ens_mean(get_index(lat_index+1,lon_index+1, & + lev_index+2,TYPE_local_ZG))) + endif + +endif + +location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) + +endif + +! If the type is wanted, return it +if(present(var_type)) var_type = local_var_type + +end subroutine get_state_meta_data + + + +subroutine end_model() +!------------------------------------------------------------------ +! +! Does any shutdown and clean-up needed for model. Can be a NULL +! INTERFACE if the model has no need to clean up storage, etc. + +if ( .not. module_initialized ) call static_init_model + +end subroutine end_model + + + +function nc_write_model_atts( ncFileID ) result (ierr) +!------------------------------------------------------------------ +! TJH 24 Oct 2006 -- Writes the model-specific attributes to a netCDF file. +! This includes coordinate variables and some metadata, but NOT +! the model state vector. We do have to allocate SPACE for the model +! state vector, but that variable gets filled as the model advances. +! +! As it stands, this routine will work for ANY model, with no modification. +! +! The simplest possible netCDF file would contain a 3D field +! containing the state of 'all' the ensemble members. This requires +! three coordinate variables -- one for each of the dimensions +! [model_size, ensemble_member, time]. A little metadata is useful, +! so we can also create some 'global' attributes. +! This is what is implemented here. +! +! Once the simplest case is working, this routine (and nc_write_model_vars) +! can be extended to create a more logical partitioning of the state vector, +! fundamentally creating a netCDF file with variables that are easily +! plotted. The bgrid model_mod is perhaps a good one to view, keeping +! in mind it is complicated by the fact it has two coordinate systems. +! There are stubs in this template, but they are only stubs. +! +! TJH 29 Jul 2003 -- for the moment, all errors are fatal, so the +! return code is always '0 == normal', since the fatal errors stop execution. +! +! assim_model_mod:init_diag_output uses information from the location_mod +! to define the location dimension and variable ID. All we need to do +! is query, verify, and fill ... +! +! Typical sequence for adding new dimensions,variables,attributes: +! NF90_OPEN ! open existing netCDF dataset +! NF90_redef ! put into define mode +! NF90_def_dim ! define additional dimensions (if any) +! NF90_def_var ! define variables: from name, type, and dims +! NF90_put_att ! assign attribute values +! NF90_ENDDEF ! end definitions: leave define mode +! NF90_put_var ! provide values for variable +! NF90_CLOSE ! close: save updated netCDF dataset + + +integer, intent(in) :: ncFileID ! netCDF file identifier +integer :: ierr ! return value of function + +integer :: nDimensions, nVariables, nAttributes, unlimitedDimID + +integer :: StateVarDimID ! netCDF pointer to state variable dimension (model size) +integer :: MemberDimID ! netCDF pointer to dimension of ensemble (ens_size) +integer :: TimeDimID ! netCDF pointer to time dimension (unlimited) + +integer :: StateVarVarID ! netCDF pointer to state variable coordinate array +integer :: StateVarID ! netCDF pointer to 3D [state,copy,time] array + +integer :: TNVarID, TN_NMVarID, UNVarID, UN_NMVarID, VNVarID, VN_NMVarID +integer :: O1VarID, O1_NMVarID, O2VarID, O2_NMVarID +integer :: NEVarID, F107VarID, ZGVarID +integer :: lonDimID, latDimID, levDimID, ilevDimID +integer :: lonVarID, latVarID, levVarID, ilevVarID +integer :: paraDimID + +! we are going to need these to record the creation date in the netCDF file. +! This is entirely optional, but nice. + +character(len=8) :: crdate ! needed by F90 DATE_AND_TIME intrinsic +character(len=10) :: crtime ! needed by F90 DATE_AND_TIME intrinsic +character(len=5) :: crzone ! needed by F90 DATE_AND_TIME intrinsic +integer, dimension(8) :: values ! needed by F90 DATE_AND_TIME intrinsic +character(len=NF90_MAX_NAME) :: str1 + +integer :: i + +if ( .not. module_initialized ) call static_init_model + +!------------------------------------------------------------------------------- +! make sure ncFileID refers to an open netCDF file, +! and then put into define mode. +!------------------------------------------------------------------------------- + +ierr = -1 ! assume things go poorly + +call nc_check(nf90_Inquire(ncFileID, nDimensions, nVariables, & + nAttributes, unlimitedDimID), 'nc_write_model_atts','inquire') +call nc_check(nf90_Redef(ncFileID),'nc_write_model_atts','redef') + +!------------------------------------------------------------------------------- +! We need the dimension ID for the number of copies/ensemble members, and +! we might as well check to make sure that Time is the Unlimited dimension. +! Our job is create the 'model size' dimension. +!------------------------------------------------------------------------------- + +call nc_check(nf90_inq_dimid(ncid=ncFileID, name="copy", dimid=MemberDimID),& + 'nc_write_model_atts', 'copy dimid') +call nc_check(nf90_inq_dimid(ncid=ncFileID, name="time", dimid= TimeDimID),& + 'nc_write_model_atts', 'time dimid') + +if ( TimeDimID /= unlimitedDimId ) then + write(msgstring,*)"Time Dimension ID ",TimeDimID, & + " should equal Unlimited Dimension ID",unlimitedDimID + call error_handler(E_ERR,"nc_write_model_atts", msgstring, source, revision, revdate) +endif + +!------------------------------------------------------------------------------- +! Define the model size / state variable dimension / whatever ... +!------------------------------------------------------------------------------- +call nc_check(nf90_def_dim(ncid=ncFileID, name="StateVariable", & + len=model_size, dimid = StateVarDimID),& + 'nc_write_model_atts', 'state def_dim') + +!------------------------------------------------------------------------------- +! Write Global Attributes +!------------------------------------------------------------------------------- + +call DATE_AND_TIME(crdate,crtime,crzone,values) +write(str1,'(''YYYY MM DD HH MM SS = '',i4,5(1x,i2.2))') & + values(1), values(2), values(3), values(5), values(6), values(7) + +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "creation_date" ,str1 ),& + 'nc_write_model_atts', 'creation put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_source" ,source ),& + 'nc_write_model_atts', 'source put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_revision",revision),& + 'nc_write_model_atts', 'revision put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_revdate" ,revdate ),& + 'nc_write_model_atts', 'revdate put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model","TIEGCM" ),& + 'nc_write_model_atts', 'model put') + +!------------------------------------------------------------------------------- +! Here is the extensible part. The simplest scenario is to output the state vector, +! parsing the state vector into model-specific parts is complicated, and you need +! to know the geometry, the output variables (PS,U,V,T,Q,...) etc. We're skipping +! complicated part. +!------------------------------------------------------------------------------- + +if ( output_state_vector ) then + + !---------------------------------------------------------------------------- + ! Create a variable for the state vector + !---------------------------------------------------------------------------- + + ! Define the state vector coordinate variable and some attributes. + call nc_check(nf90_def_var(ncid=ncFileID,name="StateVariable", xtype=nf90_int, & + dimids=StateVarDimID, varid=StateVarVarID), & + 'nc_write_model_atts', 'statevariable def_var') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "long_name", "State Variable ID"), & + 'nc_write_model_atts', 'statevariable long_name') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "units", "indexical"), & + 'nc_write_model_atts', 'statevariable units') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "valid_range", (/ 1, model_size /)), & + 'nc_write_model_atts', 'statevariable valid_range') + + ! Define the actual (3D) state vector, which gets filled as time goes on ... + call nc_check(nf90_def_var(ncid=ncFileID, name="state", xtype=nf90_real, & + dimids = (/ StateVarDimID, MemberDimID, unlimitedDimID /), & + varid=StateVarID), 'nc_write_model_atts', 'state def_var') + call nc_check(nf90_put_att(ncFileID, StateVarID, "long_name", "model state or fcopy"), & + 'nc_write_model_atts', 'state long_name') + + ! Leave define mode so we can fill the coordinate variable. + call nc_check(nf90_enddef(ncfileID), 'nc_write_model_atts', 'state enddef') + + ! Fill the state variable coordinate variable + call nc_check(nf90_put_var(ncFileID, StateVarVarID, (/ (i,i=1,model_size) /) ), & + 'nc_write_model_atts', 'state put_var') + +else + + !---------------------------------------------------------------------------- + ! We need to process the prognostic variables. + !---------------------------------------------------------------------------- + + ! This block is a stub for something more complicated. + ! Usually, the control for the execution of this block is a namelist variable. + ! Take a peek at the bgrid model_mod.f90 for a (rather complicated) example. + + !---------------------------------------------------------------------------- + ! Define the dimensions IDs + !---------------------------------------------------------------------------- + + call nc_check(nf90_def_dim(ncid=ncFileID, name="lon", & + & len = nlon, dimid = lonDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="lat", & + & len = nlat, dimid = latDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="lev", & + & len = nlev, dimid = levDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="ilev", & + & len = nilev, dimid = ilevDimID), 'nc_write_model_atts') + + if (state_num_1d > 0) then + call nc_check(nf90_def_dim(ncid=ncFileID, name="onedparameter", & + & len = state_num_1d, dimid = paraDimID), 'nc_write_model_atts') + endif + + !---------------------------------------------------------------------------- + ! Create the (empty) Variables and the Attributes + !---------------------------------------------------------------------------- + + call nc_check(nf90_def_var(ncFileID, name="lon", & + & xtype=nf90_double, dimids=lonDimID, varid=lonVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, & + & "long_name", "geographic longitude (-west, +east)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, "units", "degrees_east"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, "valid_range", & + & (/ -180.0_r8, 180.0_r8 /)),'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="lat", & + & xtype=nf90_double, dimids=latDimID, varid=latVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, & + & "long_name", "geographic latitude (-south +north)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, "units", "degrees_north"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, "valid_range", & + & (/ -90.0_r8, 90.0_r8 /)),'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="lev", & + & xtype=nf90_double, dimids=levDimID, varid=levVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "long_name", "midpoint levels"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "short_name", "ln(p0/p)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "units", ""),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "positive", "up"),& + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="ilev", & + & xtype=nf90_double, dimids=ilevDimID, varid=ilevVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "long_name", "interface levels"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "short_name", "ln(p0/p)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "units", ""),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "positive", "up"),& + 'nc_write_model_atts') + + !---------------------------------------------------------------------------- + ! Create attributes for the state vector + !---------------------------------------------------------------------------- + + if (state_num_1d > 0) then + call nc_check(nf90_def_var(ncid=ncFileID, name="F107", xtype=nf90_real, & + dimids = (/ paraDimID, MemberDimID, unlimitedDimID /), & + varid = F107VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, F107VarID, "long_name", "f107"), & + 'nc_write_model_atts') + endif + + call nc_check(nf90_def_var(ncid=ncFileID, name="ZG", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = ZGVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ZGVarID, "long_name", & + "geopotential height calculated with varying gravity"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ZGVarID, "units", "cm"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="TN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = TNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TNVarID, "long_name", "neutral temperature"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TNVarID, "units", "K"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="TN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = TN_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TN_NMVarID, "long_name", & + "neutral temperature (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TN_NMVarID, "units", "K"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="O1", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O1VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1VarID, "long_name", "atomic oxygen"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1VarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name='O1_NM', xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O1_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1_NMVarID, "long_name", "atomic oxygen (time N-1)"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1_NMVarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="O2", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O2VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2VarID, "long_name", "atomic oxygen"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2VarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name='O2_NM', xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O2_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2_NMVarID, "long_name", "atomic oxygen (time N-1)"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2_NMVarID, "units", "mmr"), & + 'nc_write_model_atts') + + if (.not. only_neutral_density) then + call nc_check(nf90_def_var(ncid=ncFileID, name="UN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = UNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UNVarID, "long_name", & + "neutral zonal wind (+east)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UNVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="UN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = UN_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UN_NMVarID, "long_name", & + "neutral zonal wind (+east) (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UN_NMVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="VN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = VNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VNVarID, "long_name", & + "neutral meridional wind (+north)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VNVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="VN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = VN_NMVarID),'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VN_NMVarID, "long_name", & + "neutral meridional wind (+north) (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VN_NMVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="NE", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, ilevDimID, MemberDimID, unlimitedDimID /), & + varid = NEVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, NEVarID, "long_name", "electron density"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, NEVarID, "units", "cm-3"), & + 'nc_write_model_atts') + endif ! (.not. only_neutral_density) + + call nc_check(nf90_enddef(ncfileID), 'nc_write_model_atts', 'prognostic enddef') + + !------------------------------------------------------------------------------- + ! Fill the variables + !------------------------------------------------------------------------------- + + call nc_check(nf90_put_var(ncFileID, lonVarID, lons), & + 'nc_write_model_atts', 'put_var lons') + call nc_check(nf90_put_var(ncFileID, latVarID, lats), & + 'nc_write_model_atts', 'put_var lats') + call nc_check(nf90_put_var(ncFileID, levVarID, levs), & + 'nc_write_model_atts', 'put_var levs') + call nc_check(nf90_put_var(ncFileID,ilevVarID,ilevs), & + 'nc_write_model_atts', 'put_var ilevs') + +endif + +!------------------------------------------------------------------------------- +! Flush the buffer and leave netCDF file open +!------------------------------------------------------------------------------- + +call nc_check(nf90_sync(ncFileID), 'nc_write_model_atts', 'sync') +if (do_output()) write (*,*) 'nc_write_model_atts: netCDF file ', ncFileID, ' is synched ' + +ierr = 0 ! If we got here, things went well. + +end function nc_write_model_atts + + + +function nc_write_model_vars( ncFileID, statevec, copyindex, timeindex ) result (ierr) +!------------------------------------------------------------------ +! TJH 24 Oct 2006 -- Writes the model variables to a netCDF file. +! +! TJH 29 Jul 2003 -- for the moment, all errors are fatal, so the +! return code is always '0 == normal', since the fatal errors stop execution. +! +! For the lorenz_96 model, each state variable is at a separate location. +! that's all the model-specific attributes I can think of ... +! +! assim_model_mod:init_diag_output uses information from the location_mod +! to define the location dimension and variable ID. All we need to do +! is query, verify, and fill ... +! +! Typical sequence for adding new dimensions,variables,attributes: +! NF90_OPEN ! open existing netCDF dataset +! NF90_redef ! put into define mode +! NF90_def_dim ! define additional dimensions (if any) +! NF90_def_var ! define variables: from name, type, and dims +! NF90_put_att ! assign attribute values +! NF90_ENDDEF ! end definitions: leave define mode +! NF90_put_var ! provide values for variable +! NF90_CLOSE ! close: save updated netCDF dataset + +integer, intent(in) :: ncFileID ! netCDF file identifier +real(r8), dimension(:), intent(in) :: statevec +integer, intent(in) :: copyindex +integer, intent(in) :: timeindex +integer :: ierr ! return value of function + +integer :: nDimensions, nVariables, nAttributes, unlimitedDimID +integer :: StateVarID +integer :: TNVarID, TN_NMVarID, UNVarID, UN_NMVarID, VNVarID, VN_NMVarID +integer :: O1VarID, O1_NMVarID, O2VarID, O2_NMVarID +integer :: NEVarID, F107VarID, ZGVarID + +type(model_type):: var + +if ( .not. module_initialized ) call static_init_model + +!------------------------------------------------------------------------------- +! make sure ncFileID refers to an open netCDF file, +!------------------------------------------------------------------------------- + +ierr = -1 ! assume things go poorly + +call nc_check(nf90_Inquire(ncFileID, nDimensions, nVariables, & + nAttributes, unlimitedDimID), 'nc_write_model_vars', 'inquire') + +if ( output_state_vector ) then + + call nc_check(NF90_inq_varid(ncFileID, 'state', StateVarID), & + 'nc_write_model_vars', 'state inq_varid' ) + call nc_check(NF90_put_var(ncFileID, StateVarID, statevec, & + start=(/ 1, copyindex, timeindex /)), & + 'nc_write_model_vars', 'state put_var') + +else + + !---------------------------------------------------------------------------- + ! We need to process the prognostic variables. + !---------------------------------------------------------------------------- + + ! This block is a stub for something more complicated. + ! Usually, the control for the execution of this block is a namelist variable. + ! Take a peek at the bgrid model_mod.f90 for a (rather complicated) example. + ! + ! Generally, it is necessary to take the statevec and decompose it into + ! the separate prognostic variables. In this (commented out) example, + ! global_Var is a user-defined type that has components like: + ! global_Var%ps, global_Var%t, ... etc. Each of those can then be passed + ! directly to the netcdf put_var routine. This may cause a huge storage + ! hit, so large models may want to avoid the duplication if possible. + + call init_model_instance(var) + call vector_to_prog_var(statevec, var) + + ! the 'start' array is crucial. In the following example, 'ps' is a 2D + ! array, and the netCDF variable "ps" is a 4D array [lat,lon,copy,time] + ! + ! call check(NF90_inq_varid(ncFileID, "ps", psVarID), "ps inq_varid") + ! call check(nf90_put_var( ncFileID, psVarID, global_Var%ps, & + ! start=(/ 1, 1, copyindex, timeindex /) ), "ps put_var") + + if (state_num_1d > 0) then + call nc_check(NF90_inq_varid(ncFileID, 'F107', F107VarID), & + 'nc_write_model_vars', 'F107 inq_varid') + call nc_check(nf90_put_var( ncFileID, F107VarID, var%vars_1d(1), & + start=(/ 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'F107 put_var') + endif + + call nc_check(NF90_inq_varid(ncFileID, 'ZG', ZGVarID), & + 'nc_write_model_vars', 'ZG inq_varid') + call nc_check(nf90_put_var( ncFileID, ZGVarID, & + var%vars_3d(:,:,:,TYPE_local_ZG+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'ZG put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'TN', TNVarID), & + 'nc_write_model_vars', 'TN inq_varid') + call nc_check(nf90_put_var( ncFileID, TNVarID, & + var%vars_3d(:,:,:,TYPE_local_TN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'TN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'TN_NM', TN_NMVarID), & + 'nc_write_model_vars', 'TN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, TN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_TN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'TN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O1', O1VarID), & + 'nc_write_model_vars', 'O1 inq_varid') + call nc_check(nf90_put_var( ncFileID, O1VarID, & + var%vars_3d(:,:,:,TYPE_local_O1+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O1 put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O1_NM', O1_NMVarID), & + 'nc_write_model_vars', 'O1_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, O1_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_O1_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O1_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O2', O2VarID), & + 'nc_write_model_vars', 'O2 inq_varid') + call nc_check(nf90_put_var( ncFileID, O2VarID, & + var%vars_3d(:,:,:,TYPE_local_O2+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O2 put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O2_NM', O2_NMVarID), & + 'nc_write_model_vars', 'O2_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, O2_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_O2_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O2_NM put_var') + + if (.not. only_neutral_density) then + call nc_check(NF90_inq_varid(ncFileID, 'UN', UNVarID), & + 'nc_write_model_vars', 'UN inq_varid') + call nc_check(nf90_put_var( ncFileID, UNVarID, & + var%vars_3d(:,:,:,TYPE_local_UN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'UN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'UN_NM', UN_NMVarID), & + 'nc_write_model_vars', 'UN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, UN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_UN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'UN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'VN', VNVarID), & + 'nc_write_model_vars', 'VN inq_varid') + call nc_check(nf90_put_var( ncFileID, VNVarID, & + var%vars_3d(:,:,:,TYPE_local_VN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'VN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'VN_NM', VN_NMVarID), & + 'nc_write_model_vars', 'VN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, VN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_VN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'VN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'NE', NEVarID), & + 'nc_write_model_vars', 'NE inq_varid') + call nc_check(nf90_put_var( ncFileID, NEVarID, & + var%vars_3d(:,:,:,TYPE_local_NE+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'NE put_var') + endif !(.not. only_neutral_density) +endif + +!------------------------------------------------------------------------------- +! Flush the buffer and leave netCDF file open +!------------------------------------------------------------------------------- + +if (do_output()) write (*,*) 'nc_write_model_vars: Finished filling variables ' +call nc_check(nf90_sync(ncFileID), 'nc_write_model_vars', 'sync') +if (do_output()) write (*,*) 'nc_write_model_vars: netCDF file is synched ' + +ierr = 0 ! If we got here, things went well. + +call end_model_instance(Var) ! should avoid any memory leaking + +end function nc_write_model_vars + + + +subroutine pert_model_state(state, pert_state, interf_provided) +!------------------------------------------------------------------ +! +! Perturbs a model state for generating initial ensembles. +! The perturbed state is returned in pert_state. +! A model may choose to provide a NULL INTERFACE by returning +! .false. for the interf_provided argument. This indicates to +! the filter that if it needs to generate perturbed states, it +! may do so by adding an O(0.1) magnitude perturbation to each +! model state variable independently. The interf_provided argument +! should be returned as .true. if the model wants to do its own +! perturbing of states. + +real(r8), intent(in) :: state(:) +real(r8), intent(out) :: pert_state(:) +logical, intent(out) :: interf_provided + +integer :: i, variable_type +type(location_type) :: temp_loc + +if ( .not. module_initialized ) call static_init_model + +! An interface is provided +interf_provided = .true. + +! If first call initialize random sequence +! CAUTION: my_task_id is NOT emsemble member number +! For example, my_task_id will be in [0,N-1] +! if a single instance of the model using N MPI tasks. + +if(first_pert_call) then + call init_random_seq(random_seq,my_task_id()) + first_pert_call = .false. +endif + +do i = 1, get_model_size() + call get_state_meta_data(i, temp_loc, variable_type) + if(variable_type == KIND_1D_PARAMETER) then + pert_state(i) = random_gaussian(random_seq,state(i),20.0_r8) + else + pert_state(i) = state(i) + endif +end do + +end subroutine pert_model_state + + + +subroutine prog_var_to_vector(var, x) +!======================================================================= +! +! Copies fields to straight vector +! + +type(model_type), intent(in) :: var +real(r8), intent(out) :: x(:) + +integer :: i, j, k, nf, indx + +if ( .not. module_initialized ) call static_init_model + +indx = 0 + +loop_longitude: do i = 1, nlon + loop_latitude: do j = 1, nlat + loop_level: do k = 1, nlev + loop_var: do nf = 1, state_num_3d + indx = indx + 1 + x(indx) = var%vars_3d(i,j,k,nf) + enddo loop_var + enddo loop_level + enddo loop_latitude + enddo loop_longitude + +loop_1d_var: do nf = 1, state_num_1d + indx = indx + 1 + x(indx) = var%vars_1d(nf) +enddo loop_1d_var + +if(indx /= model_size) then + write(msgstring, *) 'indx ',indx,' model_size ',model_size,' must be equal ' + call error_handler(E_ERR, 'prog_var_to_vector', msgstring, source, revision, revdate) +endif + +end subroutine prog_var_to_vector + + + +subroutine vector_to_prog_var(x, var) +!================================================================== +! +! Copies fields from straight vector +! + +real(r8), intent(in) :: x(:) +type(model_type), intent(out) :: var +integer :: i, j, k, nf, indx + +if ( .not. module_initialized ) call static_init_model + +indx = 0 +! TYPE_local_ZG = 0 1 +! TYPE_local_TN = 1 2 +! TYPE_local_TN_NM = 2 3 +! TYPE_local_O1 = 3 4 +! TYPE_local_O1_NM = 4 5 +! TYPE_local_O2 = 5 6 +! TYPE_local_O2_NM = 6 7 +! TYPE_local_UN = 7 8 +! TYPE_local_UN_NM = 8 9 +! TYPE_local_VN = 9 10 +! TYPE_local_VN_NM = 1011 +! TYPE_local_NE = 1112 + +loop_longitude: do i = 1, nlon + loop_latitude: do j = 1, nlat + loop_level: do k = 1, nlev + loop_var: do nf = 1, state_num_3d + indx = indx + 1 + + !Setup a minimun value for electron density. By ITL,2010 + if(nf==12 .and. x(indx)<1000) then + var%vars_3d(i,j,k,nf) = 1000 + !for neutral temperature + elseif(nf==2 .or. nf==3) then + if(x(indx)<0) then + var%vars_3d(i,j,k,nf) = 0 + elseif(x(indx)>6000) then + var%vars_3d(i,j,k,nf) = 6000 + else + var%vars_3d(i,j,k,nf) = x(indx) + end if + + !for O&O2 ratio + elseif(nf==4 .or. nf==5 .or. nf==6 .or. nf==7) then + if(x(indx)<0) then + var%vars_3d(i,j,k,nf) = 0.00001 + elseif(x(indx)>1) then + var%vars_3d(i,j,k,nf) = 0.98888 + else + var%vars_3d(i,j,k,nf) = x(indx) + end if + else + var%vars_3d(i,j,k,nf) = x(indx) + end if + + enddo loop_var + enddo loop_level + enddo loop_latitude + enddo loop_longitude + +loop_1d_var: do nf = 1, state_num_1d + indx = indx + 1 + var%vars_1d(nf) = x(indx) +enddo loop_1d_var + +if(indx /= model_size) then + write(msgstring, *) 'indx ',indx,' model_size ',model_size,' must be equal ' + call error_handler(E_ERR, 'vector_to_prog_var', msgstring, source, revision, revdate) +endif + +end subroutine vector_to_prog_var + + +subroutine init_model_instance(var,valid_time) +!================================================================== +! +! Initializes an instance of TIEGCM model state variables +! + +type(model_type), intent(out) :: var +type(time_type), optional, intent(in) :: valid_time + +if ( .not. module_initialized ) call static_init_model + +allocate(var%vars_3d(nlon, nlat, nlev, state_num_3d)) + +allocate(var%vars_1d(state_num_1d)) + +if (present(valid_time)) then + var%valid_time = valid_time +else + var%valid_time = set_time_missing() +endif + +end subroutine init_model_instance + + + +subroutine end_model_instance(var) +!================================================================== +! +! Ends an instance of TIEGCM model state variables +! + +type(model_type), intent(inout) :: var + +if ( .not. module_initialized ) call static_init_model + +deallocate(var%vars_3d) +if (state_num_1d > 0) deallocate(var%vars_1d) + +end subroutine end_model_instance + + + +subroutine update_TIEGCM_restart(file_name, var) +!======================================================================= +! +! Updates TIEGCM restart file fields +! + + character (len = *), intent(in) :: file_name + type(model_type), intent(in) :: var + + integer :: ncerr + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_id + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: utsec, doy !year + + real(r8), dimension(nlon,nlat,nlev) :: TN, TN_NM, UN, UN_NM, VN, VN_NM + real(r8), dimension(nlon,nlat,nlev) :: O1, O1_NM, O2, O2_NM + real(r8), dimension(nlon,nlat,nilev):: NE + + integer :: nlevm1 + type(time_type) :: jan1, tbase + integer :: year, month, day, hour, mins, sec + + if ( .not. module_initialized ) call static_init_model + + nlevm1 = nlev -1 + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + if (do_output()) print *, 'update_TIEGCM_restart: opening restart' + ncerr = nf90_open( file_name, NF90_WRITE, restart_id )! open with read/write access + call nc_check(ncerr, 'update_TIEGCM_restart','open') ! will die if error + if (do_output()) print *, 'update_TIEGCM_restart: opened with '//trim(nf90_strerror(ncerr)) + + + !... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'lev', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lev') + if (dim_len .ne. nlev) then + write(msgstring, *) trim(file_name), ' dim_lev = ',dim_len, ' DART expects ',nlev + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'update_TIEGCM_restart', 'inquire id of unlimited dimension time') + call nc_check( nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'update_TIEGCM_restart', 'inquire_dimension time') + + +!... put variables into TIEGCM array + + TN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_TN+1) + TN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + TN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_TN_NM+1) + TN_NM(:,:, nlev ) = TIEGCM_missing_value !fill top slot with missing value + + O1 = var%vars_3d(:,:,:,TYPE_local_O1+1) + O1_NM = var%vars_3d(:,:,:,TYPE_local_O1_NM+1) + O2 = var%vars_3d(:,:,:,TYPE_local_O2+1) + O2_NM = var%vars_3d(:,:,:,TYPE_local_O2_NM+1) + + if (.not. only_neutral_density) then + UN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_UN+1) + UN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + UN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_UN_NM+1) + UN_NM(:,:,nlev) = TIEGCM_missing_value !fill top slot with missing value + + VN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_VN+1) + VN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + VN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_VN_NM+1) + VN_NM(:,:,nlev) = TIEGCM_missing_value !fill top slot with missing value + + NE = var%vars_3d(:,:,:,TYPE_local_NE+1) + endif ! (.not. only_neutral_density) + + + call nc_check( nf90_inq_varid(restart_id, 'TN', var_id), & + 'update_TIEGCM_restart', 'inq_varid TN') + call nc_check( nf90_put_var(restart_id, var_id, values=TN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var TN') + + + call nc_check( nf90_inq_varid(restart_id, 'TN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid TN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=TN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var TN_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'O1', var_id), & + 'update_TIEGCM_restart', 'inq_varid O1') + call nc_check( nf90_put_var(restart_id, var_id, values=O1, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O1') + + + call nc_check( nf90_inq_varid(restart_id, 'O1_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid O1_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=O1_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O1_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'O2', var_id), & + 'update_TIEGCM_restart', 'inq_varid O2') + call nc_check( nf90_put_var(restart_id, var_id, values=O2, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O2') + + + call nc_check( nf90_inq_varid(restart_id, 'O2_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid O2_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=O2_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O2_NM') + + if (.not. only_neutral_density) then + call nc_check( nf90_inq_varid(restart_id, 'UN', var_id), & + 'update_TIEGCM_restart', 'inq_varid UN') + call nc_check( nf90_put_var(restart_id, var_id, values=UN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var UN') + + + call nc_check( nf90_inq_varid(restart_id, 'UN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid UN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=UN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var UN_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'VN', var_id), & + 'update_TIEGCM_restart', 'inq_varid VN') + call nc_check( nf90_put_var(restart_id, var_id, values=VN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var VN') + + + call nc_check( nf90_inq_varid(restart_id, 'VN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid VN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=VN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var VN_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'NE', var_id), & + 'update_TIEGCM_restart', 'inq_varid NE') + call nc_check( nf90_put_var(restart_id, var_id, values=NE, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nilev,1/)), & + 'update_TIEGCM_restart', 'put_var NE') + endif ! (.not. only_neutral_density) + +!... mtime and year + call get_date(var%valid_time, year, month, day, hour, mins, sec ) + jan1 = set_date(year,1,1) + tbase = var%valid_time - jan1 ! total time since the start of the year. + + call get_time(tbase, utsec, doy) + + mtime(1) = doy + 1 ! Have to add January 1 back in + mtime(2) = hour + mtime(3) = mins + + if (do_output()) print *, 'update_TIEGCM_restart: mtime (doy/hour/minute):', mtime + call nc_check( nf90_inq_varid(restart_id, 'mtime', var_id), & + 'update_TIEGCM_restart','inq_varid mtime') + call nc_check( nf90_put_var( restart_id, var_id, values=mtime, & + start = (/1,dim_time_len/), count = (/nmtime,1/)), & + 'update_TIEGCM_restart','get_var mtime') + + if (do_output()) print *, 'update_TIEGCM_restart: year:', year + call nc_check( nf90_inq_varid(restart_id, 'year', var_id), & + 'update_TIEGCM_restart','inq_varid year') + call nc_check( nf90_put_var( restart_id, var_id, values=year, & + start = (/dim_time_len/)) , & + 'update_TIEGCM_restart','get_var year') + + call nc_check( nf90_sync(restart_id), 'update_TIEGCM_restart', 'sync') + + call nc_check( nf90_close(restart_id), 'update_TIEGCM_restart', 'close') + + +end subroutine update_TIEGCM_restart + + + +subroutine read_TIEGCM_restart(file_name, var, model_time) +!======================================================================= +! +! Read TIEGCM restart file fields +! + + character (len = *), intent(in) :: file_name + type(model_type), intent(out):: var + type(time_type), intent(out):: model_time + + integer :: ncerr + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_Vtmp_id, var_mtime_id, var_year_id + real(r8), dimension(nlon,nlat,nlev) :: TN, TN_NM, UN, UN_NM, VN, VN_NM + real(r8), dimension(nlon,nlat,nlev) :: O1, O1_NM, O2, O2_NM + real(r8), dimension(nlon,nlat,nilev) :: NE + integer, dimension(:), allocatable :: yeartmp + integer, dimension(:,:), allocatable :: mtimetmp + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: year, utsec, doy + integer :: nlevm1 + + if ( .not. module_initialized ) call static_init_model + + nlevm1 = nlev - 1 + + if( .not. file_exist(file_name)) then + write(msgstring,*)trim(file_name)//' does not exist.' + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_restart:reading restart:', file_name + + call nc_check( nf90_open( file_name, NF90_NOWRITE, restart_id ), & + 'read_TIEGCM_restart', 'open') + +!... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lev', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lev') + if (dim_len .ne. nlev) then + write(msgstring, *) trim(file_name), ' dim_lev = ',dim_len, ' DART expects ',nlev + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_restart', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_restart', 'inquire_dimension time') + + +!... TN + call nc_check(nf90_inq_varid(restart_id, 'TN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TN') + +!... TN_NM + call nc_check(nf90_inq_varid(restart_id, 'TN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TN_NM') + +!... O1 + call nc_check(nf90_inq_varid(restart_id, 'O1', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O1') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O1, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O1') + +!... O1_NM + call nc_check(nf90_inq_varid(restart_id, 'O1_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O1_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O1_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O1_NM') + +!... O2 + call nc_check(nf90_inq_varid(restart_id, 'O2', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O2') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O2, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O2') + +!... O2_NM + call nc_check(nf90_inq_varid(restart_id, 'O2_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O2_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O2_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O2_NM') + + if (.not. only_neutral_density) then +!... UN + call nc_check(nf90_inq_varid(restart_id, 'UN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid UN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=UN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var UN') + +!... UN_NM + call nc_check(nf90_inq_varid(restart_id, 'UN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid UN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=UN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var UN_NM') + +!... VN + call nc_check(nf90_inq_varid(restart_id, 'VN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid VN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=VN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var VN') + +!... VN_NM + call nc_check(nf90_inq_varid(restart_id, 'VN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid VN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=VN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var VN_NM') + +!... NE + call nc_check(nf90_inq_varid(restart_id, 'NE', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid NE') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=NE, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_restart', 'get_var NE') + endif ! (.not. only_neutral_density) + +!... get mtime + call nc_check(nf90_inq_dimid(restart_id, 'mtimedim', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid mtimedim') + call nc_check(nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension mtimedim') + if (dim_len .ne. nmtime) then + write(msgstring, *) trim(file_name), ' mtimedim = ',dim_len, ' DART expects ', nmtime + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + allocate(mtimetmp(dim_len, dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'mtime', var_mtime_id), & + 'read_TIEGCM_restart', 'inq_varid mtime') + call nc_check(nf90_get_var(restart_id, var_mtime_id, values=mtimetmp), & + 'read_TIEGCM_restart', 'get_var mtime') + mtime = mtimetmp(:,dim_time_len) + deallocate(mtimetmp) + +!... get year + allocate(yeartmp(dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'year', var_year_id), & + 'read_TIEGCM_restart', 'inq_varid year') + call nc_check(nf90_get_var(restart_id, var_year_id, values=yeartmp), & + 'read_TIEGCM_restart', 'get_var year') + year = yeartmp(dim_time_len) + deallocate(yeartmp) + +!... close the file + call nc_check(nf90_close( restart_id),'read_TIEGCM_restart','close') + +!... Now we want to convert the year/doy/hour/minute to a dart time. +!... We start by finding the dart time of the year and adding the rest to it. + + if (do_output()) print *, 'read_TIEGCM_restart: mtime (doy/hour/minute) and year:', mtime, year + + doy = mtime(1) + utsec = (mtime(2)*60 + mtime(3))*60 + + model_time = set_time(utsec, doy-1) + set_date(year, 1, 1) ! Jan 1 of whatever year. + + var%valid_time = model_time + + if (do_output()) call print_time(model_time, str=" read_TIEGCM_restart: model_time ") + if (do_output()) call print_date(model_time, str=" read_TIEGCM_restart: model_date ") + +!... fill DART state vector with TIEGCM variables + + var%vars_3d(:,:,1:nlevm1,TYPE_local_TN+1) = TN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_TN+1) = TN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_TN_NM+1) = TN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_TN_NM+1) = TN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,:,TYPE_local_O1+1) = O1 + var%vars_3d(:,:,:,TYPE_local_O1_NM+1) = O1_NM + + var%vars_3d(:,:,:,TYPE_local_O2+1) = O2 + var%vars_3d(:,:,:,TYPE_local_O2_NM+1) = O2_NM + + if (.not. only_neutral_density) then + var%vars_3d(:,:,1:nlevm1,TYPE_local_UN+1) = UN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_UN+1) = UN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_UN_NM+1) = UN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_UN_NM+1) = UN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_VN+1) = VN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_VN+1) = VN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_VN_NM+1) = VN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_VN_NM+1) = VN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,:,TYPE_local_NE+1) = NE(:,:,:) + endif ! (.not. only_neutral_density) + +end subroutine read_TIEGCM_restart + + + +subroutine read_TIEGCM_definition(file_name) +!======================================================================= +! +! Read TIEGCM grid definition and Geopotential from a tiegcm restart file +! + + character (len = *), intent(in) :: file_name + integer :: ncerr + integer :: restart_id + integer :: var_lon_id, var_lat_id, var_lev_id, var_ilev_id + integer :: dim_lon_id, dim_lat_id, dim_lev_id, dim_ilev_id + integer :: dim_id, dim_len, var_mtime_id + integer :: dim_time_id, dim_time_len, missing_value_len + integer :: var_p0_id + integer :: l + real(r8) :: p0, lon_tmp + integer, dimension(:,:), allocatable :: mtimetmp + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: utsec, doy + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_definition:reading restart:', file_name + ncerr = nf90_open(file_name, NF90_NOWRITE, restart_id) + call nc_check(ncerr, 'read_TIEGCM_definition', 'open') + if (do_output()) print *, 'read_TIEGCM_definition:opened with '//trim(nf90_strerror(ncerr)) + + call nc_check(nf90_inq_dimid(restart_id, 'lon', dim_lon_id), & + 'read_TIEGCM_definition', 'inq_dimid lon') + call nc_check(nf90_inquire_dimension(restart_id, dim_lon_id, len=nlon), & + 'read_TIEGCM_definition', 'inquire_dimension lon') + allocate(lons(nlon)) + call nc_check(nf90_inq_varid(restart_id, 'lon', var_lon_id), & + 'read_TIEGCM_definition', 'inq_varid lon') + call nc_check(nf90_get_var(restart_id, var_lon_id, values=lons), & + 'read_TIEGCM_definition', 'get_var lon') + + do l = 1, nlon + lon_tmp = lons(l) + if (lon_tmp < 0) lons(l) = lons(l) + 360 ! DART [0, 360] TIEGCM [-180, 180] + enddo + + call nc_check(nf90_inq_dimid(restart_id, 'lat', dim_lat_id), & + 'read_TIEGCM_definition', 'inq_dimid lat') + call nc_check(nf90_inquire_dimension(restart_id, dim_lat_id, len=nlat), & + 'read_TIEGCM_definition', 'inquire_dimension lat') + allocate(lats(nlat)) + call nc_check(nf90_inq_varid(restart_id, 'lat', var_lat_id), & + 'read_TIEGCM_definition', 'inq_varid lat') + call nc_check(nf90_get_var(restart_id, var_lat_id, values=lats), & + 'read_TIEGCM_definition', 'get_var lat') + + call nc_check(nf90_inq_varid(restart_id, 'p0', var_p0_id), & + 'read_TIEGCM_definition', 'inq_varid p0') + call nc_check(nf90_get_var(restart_id, var_p0_id, values=p0), & + 'read_TIEGCM_definition', 'get_var p0') + + TIEGCM_reference_pressure = p0 + + call nc_check(nf90_inq_dimid(restart_id, 'lev', dim_lev_id), & + 'read_TIEGCM_definition', 'inq_dimid lev') + call nc_check(nf90_inquire_dimension(restart_id, dim_lev_id, len=nlev), & + 'read_TIEGCM_definition', 'inquire_dimension lev') + allocate(levs(nlev)) + allocate(plevs(nlev)) + call nc_check(nf90_inq_varid(restart_id, 'lev', var_lev_id), & + 'read_TIEGCM_definition', 'inq_varid lev') + call nc_check(nf90_get_var(restart_id, var_lev_id, values=levs), & + 'read_TIEGCM_definition', 'get_var lev') + + plevs = p0 * exp(-levs) * 100.0_r8 ![Pa] = 100* [millibars] = 100* [hPa] + + call nc_check(nf90_inq_dimid(restart_id, 'ilev', dim_ilev_id), & + 'read_TIEGCM_definition', 'inq_dimid ilev') + call nc_check(nf90_inquire_dimension(restart_id, dim_ilev_id, len=nilev), & + 'read_TIEGCM_definition', 'inquire_dimension ilev') + allocate(ilevs(nilev)) + allocate(pilevs(nilev)) + call nc_check(nf90_inq_varid(restart_id, 'ilev', var_ilev_id), & + 'read_TIEGCM_definition', 'inq_varid ilev') + call nc_check(nf90_get_var(restart_id, var_ilev_id, values=ilevs), & + 'read_TIEGCM_definition', 'get_var ilev') + + pilevs = p0 * exp(-ilevs) * 100.0_r8 ! [Pa] = 100* [millibars] = 100* [hPa] + + if (nlev .ne. nilev) then + write(msgstring, *) ' nlev = ',nlev,' nilev = ',nilev, 'are different; DART assumes them to be the same' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire_attribute(restart_id, nf90_global, 'missing_value', len = missing_value_len), & + 'read_TIEGCM_definition', 'inquire global attribute named missing_value') + if (missing_value_len .ne. 1) then + write(msgstring, *) ' global attribute missing_value length is ', missing_value_len, ' DART expects 1' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_get_att(restart_id, nf90_global, 'missing_value', TIEGCM_missing_value), & + 'read_TIEGCM_definition', 'get_att global attribute named missing_value') + +!... get mtime + call nc_check(nf90_inq_dimid(restart_id, 'mtimedim', dim_id), & + 'read_TIEGCM_definition', 'inq_dimid mtimedim') + call nc_check(nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_definition', 'inquire_dimension mtimedim') + if (dim_len .ne. nmtime) then + write(msgstring, *) trim(file_name), ' mtimedim = ',dim_len, ' DART expects ', nmtime + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_definition', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_definition', 'inquire_dimension time') + + allocate(mtimetmp(dim_len, dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'mtime', var_mtime_id), & + 'read_TIEGCM_definition', 'inq_varid mtime') + call nc_check(nf90_get_var(restart_id, var_mtime_id, values=mtimetmp), & + 'read_TIEGCM_definition', 'get_var mtime') + mtime = mtimetmp(:,dim_time_len) + deallocate(mtimetmp) + + call nc_check(nf90_close(restart_id),'read_TIEGCM_definition', 'close') + + if (do_output()) print *, 'read_TIEGCM_definition: mtime (doy/hour/minute):', mtime + doy = mtime(1) + utsec = (mtime(2)*60 + mtime(3))*60 + +end subroutine read_TIEGCM_definition + + + +subroutine read_TIEGCM_secondary(file_name, var) +!======================================================================= +! +! Read TIEGCM Geopotential from a tiegcm secondary output file +! + + character (len = *), intent(in):: file_name + type(model_type), intent(out):: var + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_ZGtmp_id + real(r8), dimension(nlon,nlat,nilev) :: ZG + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_secondary:reading restart:', file_name + + call nc_check(nf90_open(file_name, NF90_NOWRITE, restart_id), & + 'read_TIEGCM_secondary', 'open') +!... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_secondary', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_secondary', 'inquire_dimension time') + call nc_check(nf90_inq_varid(restart_id, 'ZG', var_ZGtmp_id), & + 'read_TIEGCM_secondary', 'inq_varid ZG') + call nc_check(nf90_get_var(restart_id, var_ZGtmp_id, values=ZG, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_secondary', 'get_var ZG') + + call nc_check(nf90_close(restart_id),'read_TIEGCM_secondary', 'close') + + var%vars_3d(:,:,:,TYPE_local_ZG+1) = ZG(:,:,:) ![cm] + +end subroutine read_TIEGCM_secondary + + +subroutine read_TIEGCM_namelist(file_name,var) +!======================================================================= +! +! Read in TIEGCM namelist input +! + character (len = *), intent(in) :: file_name + type(model_type), optional, intent(out) :: var + integer :: iunit, io + integer :: daysec = 86400 + +!---------------------------------------------------------------------------------- +! 1/3/2011, the namelist definition taken from $TGCMROOT/tiegcm1.93/src/input.F +! the following parameter values are from params.F +! modify the namelist definition for future tiegcm updates +! + integer,parameter :: mxind_time = 500 ! max number of time-dependent solar index points + integer,parameter :: mxhvols = 100 ! max number of output history file + integer,parameter :: mxseries = 10 ! max number of time series for primary histories + integer,parameter :: mxfsech = 100 ! max number of fields on secondary histories +! +! Namelist user input variables: +! + character(len=80)::& + & label, &! optional generic text label for this run + & tempdir, &! temporary directory + & magvol, &! file name or mss path to magnetic data file + & amievol ! file or mss path of amie data file (optional) +! +! date and calday are no longer supported, and are replaced by start_day, +! start_year, and calendar_advance. Date and calday are retained here so +! error usage statements can be issued if user sets one of them. +! + integer :: & + & start_day, &! starting day of year (integer 0->365) + & start_year, &! starting year (4-digit integer yyyy) + & calendar_advance,&! if > 0, advance calendar day from start_day + & date(3), &! old: model starting year, day ( 2 ints yyyy,dd) + & calday, &! old: starting calendar day (0-mxday) + & mxday, &! calendar day (0-mxday) + & step, &! model time step (integer seconds) + & dispose, &! dispose output files to mss if dispose==1 or 2 + & eddy_dif, &! 0/1 flag for DOY dependent eddy diffusion (difk, dift, xmue) + & dynamo, &! 0/1 flag for dynamo + & tideann, &! 0/1 flag for annual tide (deprecated as of May 2008) + & aurora, &! 0/1 flag for aurora + & ntask_lat, &! number of tasks in latitude dimension + & ntask_lon ! number of tasks in longitude dimension + real :: & + & tide(10), &! semidiurnal tide amplitudes and phases + & tide2(2), &! diurnal tide amplitude and phase + & tide3m3(2), &! 2-day wave amplitude and phase + & f107, &! 10.7 cm daily solar flux + & f107a, &! 10.7 cm average (81-day) solar flux + & colfac ! collision factor +! +! Input parameters that can be either constant or time-dependent: + real :: & + & power, &! hemispheric power (gw) (hpower on histories) + & ctpoten, &! cross-cap potential (volts) + & bximf, &! BX component of IMF + & byimf, &! BY component of IMF + & bzimf, &! BZ component of IMF in nT + & swvel, &! Solar wind velocity in km/s + & swden, &! Solar wind density in #/cm3 + & al, &! AL lower magnetic auroral activity index in nT + & kp, &! Kp index + & phid, &! plasma daytime flux + & phin ! plasma nighttime flux + real,dimension(4,mxind_time) :: power_time,ctpoten_time, & + & bximf_time,byimf_time,bzimf_time,swvel_time,swden_time,al_time, & + & kp_time + integer :: & + & ntimes_ctpoten,ntimes_power,ntimes_bximf,ntimes_byimf, & + & ntimes_bzimf,ntimes_swden,ntimes_swvel,ntimes_al,ntimes_kp + logical :: aluse ! logical to use AL in Weimer 2001 model or not +! +! Parameters as read from namelist: + real :: rd_power,rd_ctpoten,rd_f107,rd_f107a,rd_bximf,rd_byimf, & + & rd_bzimf,rd_swvel,rd_swden,rd_kp +! +! If indices_interp==1, time-dependent indices (power_time, ctpoten_time, etc) +! will be interpolated to model time, otherwise they will change only +! when the given values change. This has no effect on indices given as constants. +! + integer :: indices_interp=1 +! +! Import data file names: +! + integer,parameter :: mxlen_filename=80 + character(len=mxlen_filename) :: & +! +! 4/2/08 btf: Introducing Weimer 2005 model (wei05sc.F). +! Retain ability to call either the 2001 or 2005 weimer models +! for now, to facilitate comparison runs, so potential_model +! can be either WEIMER01 or WEIMER05. +! + & potential_model, &! electric potential model used + ! Values can be 'HEELIS', 'WEIMER', or 'NONE' + ! If absent, the default value is set to 'HEELIS' + & weimer_ncfile, &! path to netcdf weimer01 coefficients file + & wei05sc_ncfile, &! path to netcdf data files for weimer05 model + & gpi_ncfile, &! mss path or file path to netcdf gpi data file + & ncep_ncfile, &! ncep data file (time-gcm only) + & see_ncfile, &! mss path or file path to netcdf SEE flux data file + & imf_ncfile, &! mss path or disk file path to netcdf IMF data file + & gswm_mi_di_ncfile, &! gswm migrating diurnal data file + & gswm_mi_sdi_ncfile,&! gswm migrating semi-diurnal data file + & gswm_nm_di_ncfile, &! gswm non-migrating diurnal data file + & gswm_nm_sdi_ncfile,&! gswm non-migrating semi-diurnal data file + & saber_ncfile, &! SABER data (T,Z) + & tidi_ncfile ! TIDI data (U,V) +! +! integer,parameter :: ngpivars = 4 +! real :: gpi_vars(ngpivars) ! f107,f107a,power,ctpoten +! character(len=16) :: +! | gpi_names(ngpivars) ! names of gpi_vars +! +! Primary history user input (dimension parameters are in params.h): + character(len=80) :: & + & source, &! file containing source history (optional) + output(mxhvols) ! output file(s) (required) + integer :: & + & source_start(3), &! source history model time + & start(3,mxseries), &! primary history model start time(s) + & stop(3,mxseries), &! primary history model stop time(s) + & hist(3,mxseries), &! primary history disk write frequency + & save(3,mxseries), &! primary history file save frequency + & mxhist_prim, &! max number of histories per primary file + & msreten, &! retention period for history files + & noutput ! number of output files given +! +! Secondary history user input (dimension parameters are in params.h): + character(len=80) :: & + & secsource, &! file containing source sec_history (for mhd) + & secout(mxhvols) ! secondary history output file(s) + character(len=16) :: & + & secflds(mxfsech) ! secondary history output fields + integer :: & + & secstart(3,mxseries),&! secondary history model start time(s) + & secstop(3,mxseries), &! secondary history model stop time(s) + & sechist(3,mxseries), &! secondary history disk write frequency + & secsave(3,mxseries), &! secondary history file save frequency + & mxhist_sech, &! max number of histories per secondary file + & sech_nbyte ! 4 or 8: write real or double values to secondary file +! +! Namelist for read: + namelist/tgcm_input/ & + & label,tempdir,magvol,amievol,date,calday,step,dispose, & + & source,source_start,output,start,stop,hist,save, & + & secout,secstart,secstop,sechist,secsave,secflds, & + & potential_model,eddy_dif,dynamo,tide,tide2,tide3m3, & + & f107,f107a,power,ctpoten,bximf,byimf,bzimf,swvel,swden,al,& + & kp,colfac,tideann,aurora,gpi_ncfile,gswm_mi_di_ncfile, & + & gswm_mi_sdi_ncfile,gswm_nm_di_ncfile,gswm_nm_sdi_ncfile, & + & mxhist_prim,mxhist_sech,msreten,ntask_lat,ntask_lon, & + & start_day,start_year,calendar_advance,see_ncfile, & + & ctpoten_time,power_time,bximf_time,byimf_time,bzimf_time, & + & kp_time,al_time,swden_time,swvel_time,indices_interp, & + & imf_ncfile,saber_ncfile,tidi_ncfile,sech_nbyte,phid,phin + +!---------------------------------------------------------------------------------- + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_namelist',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_namelist: reading restart:', file_name + +!! Read the namelist entry tgcm_input from tiegcm.nml + call find_namelist_in_file("tiegcm.nml", "tgcm_input", iunit) + read(iunit, nml = tgcm_input, iostat = io) + call check_namelist_read(iunit, io, "tgcm_input") + + if (step >= daysec) then + time_step_days = int(step/daysec) + time_step_seconds = mod(step,daysec) + else + time_step_days = 0 + time_step_seconds = step + endif + + if ((state_num_1d > 0) .and. present(var)) then + var%vars_1d(1) = f107 ! f10.7 cm flux + endif + + +end subroutine read_TIEGCM_namelist + + + +subroutine ens_mean_for_model(filter_ens_mean) +!=================================================================== +! +! Not used in low-order models +! Stores provided ensemble mean within the module for later use + +real(r8), intent(in) :: filter_ens_mean(:) + +if ( .not. module_initialized ) call static_init_model + +ens_mean = filter_ens_mean + +end subroutine ens_mean_for_model + + + +subroutine get_close_obs(gc, base_obs_loc, base_obs_kind, obs_loc, obs_kind, & + num_close, close_ind, dist) +!=================================================================== +! +! Given a DART ob (referred to as "base") and a set of obs priors or +! state variables returns the subset of close ones to the "base" ob, their +! indices, and their distances to the "base" ob... + +! For vertical distance computations, general philosophy is to convert all +! vertical coordinates to a common coordinate. +! FOR NOW VERTICAL LOCALIZATION IS DONE ONLY IN HEIGHT (ZG) +! OBS VERTICAL LOCATION IS GIVEN IN HEIGHT (model_interpolate) +! STATE VERTICAL LOCATION IS GIVEN IN HEIGHT (get_state_meta_data) + +! Note that both base_obs_loc and obs_loc are intent(inout), meaning that these +! locations are possibly modified here and returned as such to the calling +! routine. The calling routine is always filter_assim and these arrays are local +! arrays within filter_assim. In other words, these modifications will only +! matter within filter_assim, but will not propagate backwards to filter. + +type(get_close_type), intent(in) :: gc +type(location_type), intent(inout) :: base_obs_loc, obs_loc(:) +integer, intent(in) :: base_obs_kind, obs_kind(:) +integer, intent(out) :: num_close, close_ind(:) +real(r8), intent(out) :: dist(:) + +integer :: k, t_ind + +call loc_get_close_obs(gc, base_obs_loc, base_obs_kind, obs_loc, obs_kind, & + num_close, close_ind, dist) + +if (state_num_1d > 0) then + +do k = 1, num_close + + t_ind = close_ind(k) + !set distance to a very large value so that it won't get updated + + if (obs_kind(t_ind) == KIND_1D_PARAMETER) then + + if (estimate_parameter) then + dist(k) = dist(k)*0.25_r8 + else !not estimate_parameter + dist(k) = 2.0_r8 * PI + endif + + endif + +enddo ! loop over k = 1, num_close + +endif + +end subroutine get_close_obs + + + +!=================================================================== +! End of model_mod +!=================================================================== +end module model_mod diff --git a/models/tiegcm/model_mod.oplus.f90 b/models/tiegcm/model_mod.oplus.f90 new file mode 100644 index 0000000000..c5c275943f --- /dev/null +++ b/models/tiegcm/model_mod.oplus.f90 @@ -0,0 +1,2768 @@ +! DART software - Copyright 2004 - 2011 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download + +module model_mod + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ + +!------------------------------------------------------------------ +! +! Interface for HAO-TIEGCM +! +!------------------------------------------------------------------ +! DART Modules +use types_mod, only : r8, digits12, missing_r8, i4, PI, & + earth_radius, gravity +use time_manager_mod, only : time_type, set_calendar_type, set_time_missing, & + set_time, get_time, print_time, & + set_date, get_date, print_date, & + operator(*), operator(+), operator(-), & + operator(>), operator(<), operator(/), & + operator(/=), operator(<=) +use location_mod, only : location_type, get_close_maxdist_init, & + get_close_obs_init, loc_get_close_obs => get_close_obs,& + set_location, get_location, query_location, & + get_dist, vert_is_height, horiz_dist_only, & + get_close_type, vert_is_undef, VERTISUNDEF, & + VERTISPRESSURE, VERTISHEIGHT, vert_is_pressure +use utilities_mod, only : file_exist, open_file, close_file, & + error_handler, E_ERR, E_MSG, E_WARN, nmlfileunit, & + do_output, find_namelist_in_file, check_namelist_read, & + do_nml_file, do_nml_term, nc_check, & + register_module +use obs_kind_mod, only : KIND_U_WIND_COMPONENT, &! just for definition + KIND_V_WIND_COMPONENT, &! just for definition + KIND_TEMPERATURE, &! neutral temperature obs + KIND_PRESSURE, &! neutral pressure obs + KIND_ELECTRON_DENSITY, &! Ne obs + KIND_ATOMIC_OXYGEN_MIXING_RATIO, &! neutral composition obs + KIND_MOLEC_OXYGEN_MIXING_RATIO, &! neutral composition obs + KIND_1D_PARAMETER, &! just for definition + KIND_GEOPOTENTIAL_HEIGHT, &! + KIND_DENSITY_ION_OP, &! Atomic oxygen ion obs + KIND_VERTICAL_TEC ! TEC obs +use random_seq_mod, only : random_seq_type, init_random_seq, random_gaussian +use mpi_utilities_mod,only : my_task_id +use typesizes +use netcdf + +implicit none +private + +public :: get_model_size, & + adv_1step, & + get_state_meta_data, & + model_interpolate, & + get_model_time_step, & + end_model, & + static_init_model, & + init_time, & + init_conditions, & + nc_write_model_atts, & + nc_write_model_vars, & + pert_model_state, & + get_close_maxdist_init, & + get_close_obs_init, & + get_close_obs, & + ens_mean_for_model +!TIEGCM specific routines +public :: model_type, & + init_model_instance, & + end_model_instance, & + prog_var_to_vector, & + vector_to_prog_var, & + read_TIEGCM_restart, & + update_TIEGCM_restart, & + read_TIEGCM_definition, & + read_TIEGCM_secondary, & + read_TIEGCM_namelist + +! version controlled file description for error handling, do not edit +character(len=128), parameter :: & + source = "$URL$", & + revision = "$Revision$", & + revdate = "$Date$" + +!------------------------------------------------------------------ +! define model parameters + +integer :: nilev, nlev, nlon, nlat +real(r8),dimension(:), allocatable :: lons, lats, levs, ilevs, plevs, pilevs +real(r8) :: TIEGCM_missing_value !! global attribute +real(r8) :: TIEGCM_reference_pressure +integer :: time_step_seconds +integer :: time_step_days +type(time_type) :: time_step + + ! IMPORTANT: Change output file names in + ! tiegcm.nml to match with the names below + ! i.e. OUTPUT='tiegcm_restart_p.nc' + ! SECOUT='tiegcm_s.nc' +character (len=19) :: restart_file = 'tiegcm_restart_p.nc' +character (len=11) :: secondary_file = 'tiegcm_s.nc' +character (len=10) :: namelist_file = 'tiegcm.nml' + + ! 3d TIEGCM variables are packed into + ! DART state vector in the following order +integer, parameter :: TYPE_local_ZG = 0 +integer, parameter :: TYPE_local_TN = 1 +integer, parameter :: TYPE_local_TN_NM = 2 +integer, parameter :: TYPE_local_O1 = 3 +integer, parameter :: TYPE_local_O1_NM = 4 +integer, parameter :: TYPE_local_O2 = 5 +integer, parameter :: TYPE_local_O2_NM = 6 +integer, parameter :: TYPE_local_UN = 7 +integer, parameter :: TYPE_local_UN_NM = 8 +integer, parameter :: TYPE_local_VN = 9 +integer, parameter :: TYPE_local_VN_NM = 10 +integer, parameter :: TYPE_local_NE = 11 +integer, parameter :: TYPE_local_OP = 12 + + + ! 2d TIEGCM variables are packed into + ! DART state vector in the following order +integer, parameter :: TYPE_local_2D_TEC = 0 + +type model_type + real(r8), pointer :: vars_3d(:,:,:,:) + real(r8), pointer :: vars_2d(:,:,:) + real(r8), pointer :: vars_1d(:) + type(time_type) :: valid_time +end type model_type + +logical :: only_neutral_density = .false. + ! .true. excludes UN VN NE OP (state_num_3d = 7) + ! .false. includes UN VN NE OP (state_num_3d = 13) +logical :: include_vTEC = .true. !only_neutral_density = .false. + ! .true. includes vTEC (state_num_2d = 1) + ! .false. excludes vTEC (state_num_2d = 0) +integer :: state_num_3d = 13 + ! -- interface levels -- + ! NE ZG + ! -- midpoint levels -- + ! O1 O1_NM O2 O2_NM + ! -- midpoint levels; top slot missing -- + ! TN TN_NM UN UN_NM VN VN_NM OP +integer :: state_num_2d = 1 + ! vTEC (computed in read_TIEGCM_restart + ! from NE, Ti, Te, Z) +integer :: state_num_1d = 0 +logical :: estimate_parameter = .false. + ! IMPORTANT: 1 D model parameters (e.g., F107) are read in from "tiegcm.nml" + ! When "estimate_parameter = .true.", "state_num_1d" should be greater than or + ! equal to 1 so that 1 D model parameters will be included in the state vector + ! (note "estimate_parameter" option is still under + ! development by Tomoko Matsuo as of June 24, 2011) + +integer :: model_size +real(r8), allocatable :: ens_mean(:) + + ! FOR NOW OBS LOCATIONS ARE EXPECTED GIVEN IN HEIGHT [m], + ! AND SO VERTICAL LOCALIZATION COORDINATE IS *always* HEIGHT + ! (note that gravity adjusted geopotential height (ZG) + ! read in from "tiegcm_s.nc") +!integer :: vert_localization_coord = VERTISHEIGHT + +namelist /model_nml/ output_state_vector, state_num_3d, state_num_1d + +logical :: output_state_vector = .false. + ! .true. results in a "state-vector" netCDF file + ! .false. results in a "prognostic-var" netCDF file +logical :: first_pert_call = .true. +type(random_seq_type) :: random_seq +!------------------------------------------------------------------ + +character(len = 129) :: msgstring +logical, save :: module_initialized = .false. + +contains + +!================================================================== + + +subroutine static_init_model() +!------------------------------------------------------------------ +! +! Called to do one time initialization of the model. As examples, +! might define information about the model size or model timestep. +! In models that require pre-computed static data, for instance +! spherical harmonic weights, these would also be computed here. +! Can be a NULL INTERFACE for the simplest models. + + integer :: i + integer :: iunit, io + +if (module_initialized) return ! only need to do this once + +! Print module information to log file and stdout. +call register_module(source, revision, revdate) + +! Since this routine calls other routines that could call this routine +! we'll say we've been initialized pretty dang early. +module_initialized = .true. + +!! Read the namelist entry for model_mod from input.nml +!call find_namelist_in_file("input.nml", "model_nml", iunit) +!read(iunit, nml = model_nml, iostat = io) +!call check_namelist_read(iunit, io, "model_nml") + +!if (do_nml_file()) write(nmlfileunit, nml=model_nml) +!if (do_nml_term()) write( * , nml=model_nml) + +! Reading in TIEGCM grid definition etc from TIEGCM restart file +call read_TIEGCM_definition(restart_file) + +! Reading in TIEGCM namelist input file (just for definition) +call read_TIEGCM_namelist(namelist_file) + +! Compute overall model size +model_size = nlon * nlat * nlev * state_num_3d & + + nlon * nlat * state_num_2d & + + state_num_1d + +if (do_output()) write(*,*) 'nlon = ', nlon +if (do_output()) write(*,*) 'nlat = ', nlat +if (do_output()) write(*,*) 'nlev = ', nlev +if (do_output()) write(*,*) 'n3D = ', state_num_3d +if (do_output()) write(*,*) 'n2D = ', state_num_2d +if (do_output()) write(*,*) 'n1D = ', state_num_1d +if (do_output()) write(*,*) 'model_size = ', model_size + +allocate (ens_mean(model_size)) + +! Might as well use the Gregorian Calendar +call set_calendar_type('Gregorian') + +! The time_step in terms of a time type must also be initialized. +time_step = set_time(time_step_seconds, time_step_days) + +end subroutine static_init_model + + + +subroutine init_conditions(x) +!------------------------------------------------------------------ +! subroutine init_conditions(x) +! +! Returns a model state vector, x, that is some sort of appropriate +! initial condition for starting up a long integration of the model. +! At present, this is only used if the namelist parameter +! start_from_restart is set to .false. in the program perfect_model_obs. +! If this option is not to be used in perfect_model_obs, or if no +! synthetic data experiments using perfect_model_obs are planned, +! this can be a NULL INTERFACE. + +real(r8), intent(out) :: x(:) + +if ( .not. module_initialized ) call static_init_model + +end subroutine init_conditions + + + +subroutine adv_1step(x, time) +!------------------------------------------------------------------ +! subroutine adv_1step(x, time) +! +! Does a single timestep advance of the model. The input value of +! the vector x is the starting condition and x is updated to reflect +! the changed state after a timestep. The time argument is intent +! in and is used for models that need to know the date/time to +! compute a timestep, for instance for radiation computations. +! This interface is only called if the namelist parameter +! async is set to 0 in perfect_model_obs of filter or if the +! program integrate_model is to be used to advance the model +! state as a separate executable. If one of these options +! is not going to be used (the model will only be advanced as +! a separate model-specific executable), this can be a +! NULL INTERFACE. + +real(r8), intent(inout) :: x(:) +type(time_type), intent(in) :: time + +end subroutine adv_1step + + + +function get_model_size() +!------------------------------------------------------------------ +! +! Returns the size of the model as an integer. Required for all +! applications. + +integer :: get_model_size + +if ( .not. module_initialized ) call static_init_model + +get_model_size = model_size + +end function get_model_size + + + +subroutine init_time(time) +!------------------------------------------------------------------ +! +! Companion interface to init_conditions. Returns a time that is somehow +! appropriate for starting up a long integration of the model. +! At present, this is only used if the namelist parameter +! start_from_restart is set to .false. in the program perfect_model_obs. +! If this option is not to be used in perfect_model_obs, or if no +! synthetic data experiments using perfect_model_obs are planned, +! this can be a NULL INTERFACE. + +type(time_type), intent(out) :: time + +if ( .not. module_initialized ) call static_init_model + +! for now, just set to 0 +time = set_time(0,0) + +end subroutine init_time + + + +subroutine model_interpolate(x, location, itype, obs_val, istatus) +!------------------------------------------------------------------ +! +! Given a state vector, a location, and a model state variable type, +! interpolates the state variable field to that location and returns +! the value in obs_val. The istatus variable should be returned as +! 0 unless there is some problem in computing the interpolation in +! which case an alternate value should be returned. The itype variable +! is a model specific integer that specifies the type of field (for +! instance temperature, zonal wind component, etc.). In low order +! models that have no notion of types of variables, this argument can +! be ignored. For applications in which only perfect model experiments +! with identity observations (i.e. only the value of a particular +! state variable is observed), this can be a NULL INTERFACE. + +real(r8), intent(in) :: x(:) +type(location_type), intent(in) :: location +integer, intent(in) :: itype +real(r8), intent(out) :: obs_val +integer, intent(out) :: istatus + +integer :: local_var_type +integer :: i, vstatus, which_vert +integer :: lat_below, lat_above, lon_below, lon_above +integer :: zero_lon_index +real(r8) :: lon_fract, temp_lon, lat_fract +real(r8) :: lon, lat, height, lon_lat_lev(3) +real(r8) :: bot_lon, top_lon, delta_lon, bot_lat, top_lat, delta_lat +real(r8) :: val(2,2), a(2) + +if ( .not. module_initialized ) call static_init_model + + +! Default for successful return +istatus = 0 +vstatus = 0 + +! Get the position +! FOR NOW OBS VERTICAL LOCATION IS ALWAYS HEIGHT +lon_lat_lev = get_location(location) +lon = lon_lat_lev(1) ! degree +lat = lon_lat_lev(2) ! degree +if(vert_is_height(location)) then + height = lon_lat_lev(3) +elseif ((vert_is_undef(location)) .or. (itype == KIND_VERTICAL_TEC)) then + ! vertical location is undefined - e.g., MIDAS_TEC + height = missing_r8 +else + which_vert = nint(query_location(location)) + write(msgstring,*) 'vertical coordinate type:',which_vert,' cannot be handled' + call error_handler(E_ERR,'model_interpolate',msgstring,source,revision,revdate) +endif + +! Get lon and lat grid specs +bot_lon = lons(1) ! 180. +delta_lon = abs((lons(1)-lons(2))) ! 5. or 2.5 +zero_lon_index = int(bot_lon/delta_lon) + 1 ! 37 or 73 +top_lon = lons(nlon) ! 175. or 177.5 +bot_lat = lats(1) ! +top_lat = lats(nlat) ! +delta_lat = abs((lats(1)-lats(2))) ! + + +! Compute bracketing lon indices: +! TIEGCM [-180 175] DART [180, 185, ..., 355, 0, 5, ..., 175] +if(lon > top_lon .and. lon < bot_lon) then ! at wraparound point [175 < lon < 180] + lon_below = nlon + lon_above = 1 + lon_fract = (lon - top_lon) / delta_lon +elseif (lon >= bot_lon) then ! [180 <= lon <= 360] + lon_below = int((lon - bot_lon) / delta_lon) + 1 + lon_above = lon_below + 1 + lon_fract = (lon - lons(lon_below)) / delta_lon +else ! [0 <= lon <= 175 ] + lon_below = int((lon - 0.0_r8) / delta_lon) + zero_lon_index + lon_above = lon_below + 1 + lon_fract = (lon - lons(lon_below)) / delta_lon +endif + +! Compute neighboring lat rows: TIEGCM [-87.5, 87.5] DART [-90, 90] +! NEED TO BE VERY CAREFUL ABOUT POLES; WHAT'S BEING DONE IS NOT GREAT! +if(lat >= bot_lat .and. lat <= top_lat) then ! -87.5 <= lat <= 87.5 + lat_below = int((lat - bot_lat) / delta_lat) + 1 + lat_above = lat_below + 1 + lat_fract = (lat - lats(lat_below) ) / delta_lat +else if(lat < bot_lat) then ! South of bottom lat + lat_below = 1 + lat_above = 1 + lat_fract = 1.0_r8 +else ! North of top lat + lat_below = nlat + lat_above = nlat + lat_fract = 1.0_r8 +endif + +! Now, need to find the values for the four corners +if ((vert_is_undef(location)) .or. (itype == KIND_VERTICAL_TEC)) then !2D fields + + if (itype == KIND_VERTICAL_TEC) then + local_var_type = TYPE_local_2D_TEC + val(1, 1) = x(get_index_2d(lat_below, lon_below, local_var_type)) + val(1, 2) = x(get_index_2d(lat_above, lon_below, local_var_type)) + val(2, 1) = x(get_index_2d(lat_below, lon_above, local_var_type)) + val(2, 2) = x(get_index_2d(lat_above, lon_above, local_var_type)) + endif + +else !3D fields + + call get_val(val(1, 1), x, lon_below, lat_below, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(1, 2), x, lon_below, lat_above, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(2, 1), x, lon_above, lat_below, height, itype, vstatus) + if (vstatus /= 1) call get_val(val(2, 2), x, lon_above, lat_above, height, itype, vstatus) + +endif + +! istatus meaning return expected obs? assimilate? +! 0 obs and model are fine; yes yes +! 1 fatal problem; no no +! 2 exclude valid obs yes no +! +istatus = vstatus +if(istatus /= 1) then + do i = 1, 2 + a(i) = lon_fract * val(2, i) + (1.0_r8 - lon_fract) * val(1, i) + end do + obs_val = lat_fract * a(2) + (1.0_r8 - lat_fract) * a(1) +else + obs_val = missing_r8 +endif + + +end subroutine model_interpolate + + + +subroutine get_val(val, x, lon_index, lat_index, height, obs_kind, istatus) +!------------------------------------------------------------------ +! +real(r8), intent(out) :: val +real(r8), intent(in) :: x(:) +integer, intent(in) :: lon_index, lat_index +real(r8), intent(in) :: height +integer, intent(in) :: obs_kind +integer, intent(out) :: istatus +integer :: var_type +integer :: k, lev_top, lev_bottom +real(r8) :: zgrid, delta_z, zgrid_top, zgrid_bottom +real(r8) :: val_top, val_bottom, frac_lev + + +! No errors to start with +istatus = 0 + +! To find a layer height: what's the unit of height [m] +! pressure level ln(p0/p) -- interface [-7.0 7.0] and midlevel [-6.75 7.25] +! Ne and ZG are defined at interface +! T, U, V, O, O2 & OP are defined at midlevel +! T, U, V at top midlevel pressure level are missing values in TIEGCM +! but filled in DART with the values at nlev -1 + +if (obs_kind == KIND_ELECTRON_DENSITY) then + + zgrid_bottom = & + x(get_index(lat_index,lon_index,1,TYPE_local_ZG))/100.0_r8 ![m] = /100 [cm] + zgrid_top = & + x(get_index(lat_index,lon_index,nlev,TYPE_local_ZG))/100.0_r8 + if ((zgrid_bottom > height) .or. (zgrid_top < height)) then + istatus = 1 !obs height is above or below the model boundary + val = 0.0 + return + endif + + h_loop_interface:do k = 2, nlev + + zgrid = x(get_index(lat_index,lon_index,k,TYPE_local_ZG))/100.0_r8 ![m] = /100 [cm] + + if (height <= zgrid) then + lev_top = k + lev_bottom = lev_top -1 + delta_z = zgrid - & + x(get_index(lat_index,lon_index,lev_bottom,TYPE_local_ZG))/100.0_r8 + frac_lev = (zgrid - height)/delta_z + exit h_loop_interface + endif + + enddo h_loop_interface + +else + + !mid_level 1 + zgrid_bottom = 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,1,TYPE_local_ZG)) + & ![m] = /100 [cm] + x(get_index(lat_index,lon_index,2,TYPE_local_ZG))) + + !mid_level nlev-1 + zgrid_top = 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,nlev-1,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,nlev,TYPE_local_ZG))) + + if ((zgrid_bottom > height) .or. (zgrid_top < height)) then + istatus = 1 !obs height is above or below the model boundary + val = 0.0 + return + endif + + h_loop_midpoint:do k = 2, nlev-1 + + zgrid = 0.50_r8 / 100.0_r8 * & ! [m] = ZGtiegcm/100 [cm] + (x(get_index(lat_index,lon_index,k,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,k+1,TYPE_local_ZG))) + + if (height <= zgrid) then + lev_top = k + lev_bottom = lev_top -1 + delta_z = zgrid - 0.50_r8 / 100.0_r8 * & + (x(get_index(lat_index,lon_index,lev_bottom,TYPE_local_ZG)) + & + x(get_index(lat_index,lon_index,lev_bottom+1,TYPE_local_ZG))) + frac_lev = (zgrid - height)/delta_z + exit h_loop_midpoint + endif + + enddo h_loop_midpoint + +endif + + +if (obs_kind == KIND_ATOMIC_OXYGEN_MIXING_RATIO) then + + var_type = TYPE_local_O1 + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_MOLEC_OXYGEN_MIXING_RATIO) then + + var_type = TYPE_local_O2 + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_TEMPERATURE) then + + var_type = TYPE_local_TN + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_PRESSURE) then + + val_top = plevs(lev_top) !pressure at midpoint [Pa] + val_bottom = plevs(lev_bottom) !pressure at midpoint [Pa] + +elseif (obs_kind == KIND_ELECTRON_DENSITY) then + + var_type = TYPE_local_NE + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +elseif (obs_kind == KIND_DENSITY_ION_OP) then + + var_type = TYPE_local_OP + val_top = x(get_index(lat_index, lon_index, lev_top, var_type)) + val_bottom = x(get_index(lat_index, lon_index, lev_bottom, var_type)) + +else + + istatus = 1 + val = 0. + return + +endif + + +if (obs_kind == KIND_PRESSURE) then + val = exp(frac_lev * log(val_bottom) + (1.0 - frac_lev) * log(val_top)) +else +!KIND_ELECTRON_DENSITY +!KIND_TEMPERATURE +!KIND_MOLEC_OXYGEN_MIXING_RATIO +!KIND_ATOMIC_OXYGEN_MIXING_RATIO + val = frac_lev * val_bottom + (1.0 - frac_lev) * val_top +endif + +end subroutine get_val + + + +function get_index(lat_index, lon_index, lev_index, var_type) +!------------------------------------------------------------------ +! +integer, intent(in) :: lat_index, lon_index, lev_index, var_type +integer :: get_index +integer :: initial_3d_index + +initial_3d_index = 1 + +get_index = initial_3d_index & + + var_type + (lev_index -1)*state_num_3d & + + (lat_index -1)*state_num_3d*nlev & + + (lon_index -1)*state_num_3d*nlev*nlat + +end function get_index + + + +function get_index_2d(lat_index, lon_index, var_type) +!------------------------------------------------------------------ +! +integer, intent(in) :: lat_index, lon_index, var_type +integer :: get_index_2d +integer :: initial_2d_index + +initial_2d_index = 1 + state_num_3d * nlon * nlat * nlev + +get_index_2d = initial_2d_index & + + var_type + (lat_index -1)*state_num_2d & + + (lon_index -1)*state_num_2d*nlat + +end function get_index_2d + + + +function get_model_time_step() +!------------------------------------------------------------------ +! +! Returns the the time step of the model; the smallest increment +! in time that the model is capable of advancing the state in a given +! implementation. This interface is required for all applications. + +type(time_type) :: get_model_time_step + +if ( .not. module_initialized ) call static_init_model + +get_model_time_step = time_step + +end function get_model_time_step + + + +subroutine get_state_meta_data(index_in, location, var_type) +!------------------------------------------------------------------ +! +! Given an integer index into the state vector structure, returns the +! associated location. A second intent(out) optional argument kind +! can be returned if the model has more than one type of field (for +! instance temperature and zonal wind component). This interface is +! required for all filter applications as it is required for computing +! the distance between observations and state variables. + +integer, intent(in) :: index_in +type(location_type), intent(out) :: location +integer, optional, intent(out) :: var_type + +integer :: indx, num_per_col, col_num, col_elem +integer :: lon_index, lat_index, lev_index +real(r8) :: lon, lat, lev, height +integer :: local_var_type, var_type_temp +integer :: model_utsec +integer :: model_size_3d, model_size_2d, model_size_1d + +!model_size = model_size_3d + model_size_2d + model_size_1d +model_size_3d = state_num_3d * nlon * nlat * nlev +model_size_2d = state_num_2d * nlon * nlat +model_size_1d = state_num_1d + +if ( .not. module_initialized ) call static_init_model + +!--------------------------------------------------------------------------- +!--1D vector----------------------------------------------------- +if (index_in >= (model_size_3d + model_size_2d + 1)) then + +! PARAMETERS DO NOT HAVE LOCATION + local_var_type = KIND_1D_PARAMETER + lev = pilevs(22) !return a fake value + height = 400000_r8 !return a fake value + lat = 0.0_r8 !return a fake value + lat = 0.0_r8 !return a fake value + + location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) + +!--2D fields----------------------------------------------------- +elseif ((index_in >= model_size_3d +1 ) .and. & + (index_in <= (model_size_3d + model_size_2d))) then + +! Easier to compute with a 0 to size -1 index + indx = index_in - model_size_3d - 1 + +! Compute number of items per column + num_per_col = state_num_2d + +! What column is this index in + col_num = indx / num_per_col + col_elem = indx - col_num * num_per_col + +! what lon and lat index for this column + lon_index = col_num /nlat + lat_index = col_num - lon_index * nlat + +! Get actual lon lat values from static_init_model arrays + lon = lons(lon_index + 1) + lat = lats(lat_index + 1) + +! Find which var_type this element is +! var_type_temp = mod(col_elem, state_num_2d) +! May use var_type_temp to find var_type +! BUT now there is only one 2D fields type + local_var_type = KIND_VERTICAL_TEC + + if (local_var_type == KIND_VERTICAL_TEC) then + !vTEC is 2-D fields (height is not defined) + height = 300000_r8 !return a fake value + endif + + location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) + +!--3D fields--------------------------------------------------- +else + +! Easier to compute with a 0 to size -1 index + indx = index_in -1 + +! Compute number of items per column + num_per_col = nlev * state_num_3d + +! What column is this index in + col_num = indx / num_per_col + col_elem = indx - col_num * num_per_col + +! what lon and lat index for this column + lon_index = col_num /nlat + lat_index = col_num - lon_index * nlat + +! Now figure out which beast in column this is + lev_index = col_elem / state_num_3d + +! Get actual lon lat values from static_init_model arrays + lon = lons(lon_index + 1) + lat = lats(lat_index + 1) + +! Find which var_type this element is + var_type_temp = mod(col_elem, state_num_3d) + + if (var_type_temp == TYPE_local_ZG) then !ZG + local_var_type = KIND_GEOPOTENTIAL_HEIGHT + else if (var_type_temp == TYPE_local_TN) then !TN + local_var_type = KIND_TEMPERATURE + else if (var_type_temp == TYPE_local_TN_NM) then !TN_NM + local_var_type = KIND_TEMPERATURE + else if (var_type_temp == TYPE_local_O1) then !O1 + local_var_type = KIND_ATOMIC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_O1_NM) then !O1_NM + local_var_type = KIND_ATOMIC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_O2) then !O2 + local_var_type = KIND_MOLEC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_O2_NM) then !O2_NM + local_var_type = KIND_MOLEC_OXYGEN_MIXING_RATIO + else if (var_type_temp == TYPE_local_UN) then !UN + local_var_type = KIND_U_WIND_COMPONENT + else if (var_type_temp == TYPE_local_UN_NM) then !UN_NM + local_var_type = KIND_U_WIND_COMPONENT + else if (var_type_temp == TYPE_local_VN) then !VN + local_var_type = KIND_V_WIND_COMPONENT + else if (var_type_temp == TYPE_local_VN_NM) then !VN_NM + local_var_type = KIND_V_WIND_COMPONENT + else if (var_type_temp == TYPE_local_NE) then !NE + local_var_type = KIND_ELECTRON_DENSITY + else if (var_type_temp == TYPE_local_OP) then !OP + local_var_type = KIND_DENSITY_ION_OP + else + write(msgstring,*)"unknown var_type for index ",index_in + call error_handler(E_ERR,"get_state_meta_data", msgstring, source, revision, revdate) + endif + +!----------------------------------------------------- +!TIEGCM's 'natural' vertical coordinate is pressure +!if ((local_var_type == KIND_ELECTRON_DENSITY) .or. & !NE defined at interface levels +! (local_var_type == KIND_GEOPOTENTIAL_HEIGHT)) then !ZG defined at interface levels +! lev = pilevs(lev_index + 1) +!else !TN UN VN O1 defined at midpoints +! lev = plevs(lev_index + 1) +!endif +!location = set_location(lon,lat,lev,VERTISPRESSURE) !pressure(2),height(3) +!----------------------------------------------------- + + if ((local_var_type == KIND_ELECTRON_DENSITY) .or. & + (local_var_type == KIND_GEOPOTENTIAL_HEIGHT)) then + !NE defined at interface levels + !ZG defined at interface levels + height = ens_mean(get_index(lat_index+1,& + lon_index+1,& + lev_index+1,& + TYPE_local_ZG))/100.0_r8 ![m] = ZGtiegcm/100 [cm] + else + !TN UN VN O1 OP defined at midpoints + !TIEGCM: top midpoint slot contains missing values for TN UN VN OP + if (lev_index+2 > nlev) then + height = ens_mean(get_index(lat_index+1,lon_index+1, & + nlev,TYPE_local_ZG)) / 100.0_r8 + else + height = 0.50_r8 / 100.0_r8 * & + (ens_mean(get_index(lat_index+1,lon_index+1, & + lev_index+1,TYPE_local_ZG)) + & + ens_mean(get_index(lat_index+1,lon_index+1, & + lev_index+2,TYPE_local_ZG))) + endif + endif + + location = set_location(lon,lat,height,VERTISHEIGHT) ! pressure(2), height(3) + +endif +!--------------------------------------------------------------------------- +!--------------------------------------------------------------------------- + +! If the type is wanted, return it +if(present(var_type)) var_type = local_var_type + +end subroutine get_state_meta_data + + + +subroutine end_model() +!------------------------------------------------------------------ +! +! Does any shutdown and clean-up needed for model. Can be a NULL +! INTERFACE if the model has no need to clean up storage, etc. + +if ( .not. module_initialized ) call static_init_model + +end subroutine end_model + + + +function nc_write_model_atts( ncFileID ) result (ierr) +!------------------------------------------------------------------ +! TJH 24 Oct 2006 -- Writes the model-specific attributes to a netCDF file. +! This includes coordinate variables and some metadata, but NOT +! the model state vector. We do have to allocate SPACE for the model +! state vector, but that variable gets filled as the model advances. +! +! As it stands, this routine will work for ANY model, with no modification. +! +! The simplest possible netCDF file would contain a 3D field +! containing the state of 'all' the ensemble members. This requires +! three coordinate variables -- one for each of the dimensions +! [model_size, ensemble_member, time]. A little metadata is useful, +! so we can also create some 'global' attributes. +! This is what is implemented here. +! +! Once the simplest case is working, this routine (and nc_write_model_vars) +! can be extended to create a more logical partitioning of the state vector, +! fundamentally creating a netCDF file with variables that are easily +! plotted. The bgrid model_mod is perhaps a good one to view, keeping +! in mind it is complicated by the fact it has two coordinate systems. +! There are stubs in this template, but they are only stubs. +! +! TJH 29 Jul 2003 -- for the moment, all errors are fatal, so the +! return code is always '0 == normal', since the fatal errors stop execution. +! +! assim_model_mod:init_diag_output uses information from the location_mod +! to define the location dimension and variable ID. All we need to do +! is query, verify, and fill ... +! +! Typical sequence for adding new dimensions,variables,attributes: +! NF90_OPEN ! open existing netCDF dataset +! NF90_redef ! put into define mode +! NF90_def_dim ! define additional dimensions (if any) +! NF90_def_var ! define variables: from name, type, and dims +! NF90_put_att ! assign attribute values +! NF90_ENDDEF ! end definitions: leave define mode +! NF90_put_var ! provide values for variable +! NF90_CLOSE ! close: save updated netCDF dataset + + +integer, intent(in) :: ncFileID ! netCDF file identifier +integer :: ierr ! return value of function + +integer :: nDimensions, nVariables, nAttributes, unlimitedDimID + +integer :: StateVarDimID ! netCDF pointer to state variable dimension (model size) +integer :: MemberDimID ! netCDF pointer to dimension of ensemble (ens_size) +integer :: TimeDimID ! netCDF pointer to time dimension (unlimited) + +integer :: StateVarVarID ! netCDF pointer to state variable coordinate array +integer :: StateVarID ! netCDF pointer to 3D [state,copy,time] array + +integer :: TNVarID, TN_NMVarID, UNVarID, UN_NMVarID, VNVarID, VN_NMVarID +integer :: O1VarID, O1_NMVarID, O2VarID, O2_NMVarID +integer :: NEVarID, OPVarID, F107VarID, ZGVarID, vTEC_VarID +integer :: lonDimID, latDimID, levDimID, ilevDimID +integer :: lonVarID, latVarID, levVarID, ilevVarID +integer :: paraDimID + +! we are going to need these to record the creation date in the netCDF file. +! This is entirely optional, but nice. + +character(len=8) :: crdate ! needed by F90 DATE_AND_TIME intrinsic +character(len=10) :: crtime ! needed by F90 DATE_AND_TIME intrinsic +character(len=5) :: crzone ! needed by F90 DATE_AND_TIME intrinsic +integer, dimension(8) :: values ! needed by F90 DATE_AND_TIME intrinsic +character(len=NF90_MAX_NAME) :: str1 + +integer :: i + +if ( .not. module_initialized ) call static_init_model + +!------------------------------------------------------------------------------- +! make sure ncFileID refers to an open netCDF file, +! and then put into define mode. +!------------------------------------------------------------------------------- + +ierr = -1 ! assume things go poorly + +call nc_check(nf90_Inquire(ncFileID, nDimensions, nVariables, & + nAttributes, unlimitedDimID), 'nc_write_model_atts','inquire') +call nc_check(nf90_Redef(ncFileID),'nc_write_model_atts','redef') + +!------------------------------------------------------------------------------- +! We need the dimension ID for the number of copies/ensemble members, and +! we might as well check to make sure that Time is the Unlimited dimension. +! Our job is create the 'model size' dimension. +!------------------------------------------------------------------------------- + +call nc_check(nf90_inq_dimid(ncid=ncFileID, name="copy", dimid=MemberDimID),& + 'nc_write_model_atts', 'copy dimid') +call nc_check(nf90_inq_dimid(ncid=ncFileID, name="time", dimid= TimeDimID),& + 'nc_write_model_atts', 'time dimid') + +if ( TimeDimID /= unlimitedDimId ) then + write(msgstring,*)"Time Dimension ID ",TimeDimID, & + " should equal Unlimited Dimension ID",unlimitedDimID + call error_handler(E_ERR,"nc_write_model_atts", msgstring, source, revision, revdate) +endif + +!------------------------------------------------------------------------------- +! Define the model size / state variable dimension / whatever ... +!------------------------------------------------------------------------------- +call nc_check(nf90_def_dim(ncid=ncFileID, name="StateVariable", & + len=model_size, dimid = StateVarDimID),& + 'nc_write_model_atts', 'state def_dim') + +!------------------------------------------------------------------------------- +! Write Global Attributes +!------------------------------------------------------------------------------- + +call DATE_AND_TIME(crdate,crtime,crzone,values) +write(str1,'(''YYYY MM DD HH MM SS = '',i4,5(1x,i2.2))') & + values(1), values(2), values(3), values(5), values(6), values(7) + +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "creation_date" ,str1 ),& + 'nc_write_model_atts', 'creation put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_source" ,source ),& + 'nc_write_model_atts', 'source put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_revision",revision),& + 'nc_write_model_atts', 'revision put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model_revdate" ,revdate ),& + 'nc_write_model_atts', 'revdate put') +call nc_check(nf90_put_att(ncFileID, NF90_GLOBAL, "model","TIEGCM" ),& + 'nc_write_model_atts', 'model put') + +!------------------------------------------------------------------------------- +! Here is the extensible part. The simplest scenario is to output the state vector, +! parsing the state vector into model-specific parts is complicated, and you need +! to know the geometry, the output variables (PS,U,V,T,Q,...) etc. We're skipping +! complicated part. +!------------------------------------------------------------------------------- + +if ( output_state_vector ) then + + !---------------------------------------------------------------------------- + ! Create a variable for the state vector + !---------------------------------------------------------------------------- + + ! Define the state vector coordinate variable and some attributes. + call nc_check(nf90_def_var(ncid=ncFileID,name="StateVariable", xtype=nf90_int, & + dimids=StateVarDimID, varid=StateVarVarID), & + 'nc_write_model_atts', 'statevariable def_var') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "long_name", "State Variable ID"), & + 'nc_write_model_atts', 'statevariable long_name') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "units", "indexical"), & + 'nc_write_model_atts', 'statevariable units') + call nc_check(nf90_put_att(ncFileID, StateVarVarID, "valid_range", (/ 1, model_size /)), & + 'nc_write_model_atts', 'statevariable valid_range') + + ! Define the actual (3D) state vector, which gets filled as time goes on ... + call nc_check(nf90_def_var(ncid=ncFileID, name="state", xtype=nf90_real, & + dimids = (/ StateVarDimID, MemberDimID, unlimitedDimID /), & + varid=StateVarID), 'nc_write_model_atts', 'state def_var') + call nc_check(nf90_put_att(ncFileID, StateVarID, "long_name", "model state or fcopy"), & + 'nc_write_model_atts', 'state long_name') + + ! Leave define mode so we can fill the coordinate variable. + call nc_check(nf90_enddef(ncfileID), 'nc_write_model_atts', 'state enddef') + + ! Fill the state variable coordinate variable + call nc_check(nf90_put_var(ncFileID, StateVarVarID, (/ (i,i=1,model_size) /) ), & + 'nc_write_model_atts', 'state put_var') + +else + + !---------------------------------------------------------------------------- + ! We need to process the prognostic variables. + !---------------------------------------------------------------------------- + + ! This block is a stub for something more complicated. + ! Usually, the control for the execution of this block is a namelist variable. + ! Take a peek at the bgrid model_mod.f90 for a (rather complicated) example. + + !---------------------------------------------------------------------------- + ! Define the dimensions IDs + !---------------------------------------------------------------------------- + + call nc_check(nf90_def_dim(ncid=ncFileID, name="lon", & + & len = nlon, dimid = lonDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="lat", & + & len = nlat, dimid = latDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="lev", & + & len = nlev, dimid = levDimID), 'nc_write_model_atts') + call nc_check(nf90_def_dim(ncid=ncFileID, name="ilev", & + & len = nilev, dimid = ilevDimID), 'nc_write_model_atts') + + if (state_num_1d > 0) then + call nc_check(nf90_def_dim(ncid=ncFileID, name="onedparameter", & + & len = state_num_1d, dimid = paraDimID), 'nc_write_model_atts') + endif + + !---------------------------------------------------------------------------- + ! Create the (empty) Variables and the Attributes + !---------------------------------------------------------------------------- + + call nc_check(nf90_def_var(ncFileID, name="lon", & + & xtype=nf90_double, dimids=lonDimID, varid=lonVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, & + & "long_name", "geographic longitude (-west, +east)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, "units", "degrees_east"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, lonVarID, "valid_range", & + & (/ -180.0_r8, 180.0_r8 /)),'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="lat", & + & xtype=nf90_double, dimids=latDimID, varid=latVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, & + & "long_name", "geographic latitude (-south +north)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, "units", "degrees_north"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, latVarID, "valid_range", & + & (/ -90.0_r8, 90.0_r8 /)),'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="lev", & + & xtype=nf90_double, dimids=levDimID, varid=levVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "long_name", "midpoint levels"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "short_name", "ln(p0/p)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "units", ""),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, levVarID, "positive", "up"),& + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncFileID, name="ilev", & + & xtype=nf90_double, dimids=ilevDimID, varid=ilevVarID),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "long_name", "interface levels"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "short_name", "ln(p0/p)"),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "units", ""),& + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ilevVarID, "positive", "up"),& + 'nc_write_model_atts') + + !---------------------------------------------------------------------------- + ! Create attributes for the state vector + !---------------------------------------------------------------------------- + + if (state_num_1d > 0) then + call nc_check(nf90_def_var(ncid=ncFileID, name="F107", xtype=nf90_real, & + dimids = (/ paraDimID, MemberDimID, unlimitedDimID /), & + varid = F107VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, F107VarID, "long_name", "f107"), & + 'nc_write_model_atts') + endif + + call nc_check(nf90_def_var(ncid=ncFileID, name="ZG", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = ZGVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ZGVarID, "long_name", & + "geopotential height calculated with varying gravity"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, ZGVarID, "units", "cm"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="TN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = TNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TNVarID, "long_name", "neutral temperature"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TNVarID, "units", "K"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="TN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = TN_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TN_NMVarID, "long_name", & + "neutral temperature (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, TN_NMVarID, "units", "K"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="O1", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O1VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1VarID, "long_name", "atomic oxygen"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1VarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name='O1_NM', xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O1_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1_NMVarID, "long_name", "atomic oxygen (time N-1)"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O1_NMVarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="O2", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O2VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2VarID, "long_name", "atomic oxygen"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2VarID, "units", "mmr"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name='O2_NM', xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = O2_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2_NMVarID, "long_name", "atomic oxygen (time N-1)"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, O2_NMVarID, "units", "mmr"), & + 'nc_write_model_atts') + + + if (include_vTEC) then + call nc_check(nf90_def_var(ncid=ncFileID, name='vTEC', xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, MemberDimID, unlimitedDimID/), & + varid = vTEC_VarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, vTEC_VarID, "long_name", "Total Electron Content"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, vTEC_VarID, "units", "TECU"),'nc_write_model_atts') + endif + + + if (.not. only_neutral_density) then + call nc_check(nf90_def_var(ncid=ncFileID, name="UN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = UNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UNVarID, "long_name", & + "neutral zonal wind (+east)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UNVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="UN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = UN_NMVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UN_NMVarID, "long_name", & + "neutral zonal wind (+east) (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, UN_NMVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="VN", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = VNVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VNVarID, "long_name", & + "neutral meridional wind (+north)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VNVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="VN_NM", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = VN_NMVarID),'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VN_NMVarID, "long_name", & + "neutral meridional wind (+north) (time N-1)"), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, VN_NMVarID, "units", "cm/s"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="OP", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, levDimID, MemberDimID, unlimitedDimID /), & + varid = OPVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, OPVarID, "long_name", "oxygen ion density"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, OPVarID, "units", "cm-3"), & + 'nc_write_model_atts') + + call nc_check(nf90_def_var(ncid=ncFileID, name="NE", xtype=nf90_real, & + dimids = (/ lonDimID, latDimID, ilevDimID, MemberDimID, unlimitedDimID /), & + varid = NEVarID), 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, NEVarID, "long_name", "electron density"), & + 'nc_write_model_atts') + call nc_check(nf90_put_att(ncFileID, NEVarID, "units", "cm-3"), & + 'nc_write_model_atts') + + endif ! (.not. only_neutral_density) + + call nc_check(nf90_enddef(ncfileID), 'nc_write_model_atts', 'prognostic enddef') + + !------------------------------------------------------------------------------- + ! Fill the variables + !------------------------------------------------------------------------------- + + call nc_check(nf90_put_var(ncFileID, lonVarID, lons), & + 'nc_write_model_atts', 'put_var lons') + call nc_check(nf90_put_var(ncFileID, latVarID, lats), & + 'nc_write_model_atts', 'put_var lats') + call nc_check(nf90_put_var(ncFileID, levVarID, levs), & + 'nc_write_model_atts', 'put_var levs') + call nc_check(nf90_put_var(ncFileID,ilevVarID,ilevs), & + 'nc_write_model_atts', 'put_var ilevs') + +endif + +!------------------------------------------------------------------------------- +! Flush the buffer and leave netCDF file open +!------------------------------------------------------------------------------- + +call nc_check(nf90_sync(ncFileID), 'nc_write_model_atts', 'sync') +if (do_output()) write (*,*) 'nc_write_model_atts: netCDF file ', ncFileID, ' is synched ' + +ierr = 0 ! If we got here, things went well. + +end function nc_write_model_atts + + + +function nc_write_model_vars( ncFileID, statevec, copyindex, timeindex ) result (ierr) +!------------------------------------------------------------------ +! TJH 24 Oct 2006 -- Writes the model variables to a netCDF file. +! +! TJH 29 Jul 2003 -- for the moment, all errors are fatal, so the +! return code is always '0 == normal', since the fatal errors stop execution. +! +! For the lorenz_96 model, each state variable is at a separate location. +! that's all the model-specific attributes I can think of ... +! +! assim_model_mod:init_diag_output uses information from the location_mod +! to define the location dimension and variable ID. All we need to do +! is query, verify, and fill ... +! +! Typical sequence for adding new dimensions,variables,attributes: +! NF90_OPEN ! open existing netCDF dataset +! NF90_redef ! put into define mode +! NF90_def_dim ! define additional dimensions (if any) +! NF90_def_var ! define variables: from name, type, and dims +! NF90_put_att ! assign attribute values +! NF90_ENDDEF ! end definitions: leave define mode +! NF90_put_var ! provide values for variable +! NF90_CLOSE ! close: save updated netCDF dataset + +integer, intent(in) :: ncFileID ! netCDF file identifier +real(r8), dimension(:), intent(in) :: statevec +integer, intent(in) :: copyindex +integer, intent(in) :: timeindex +integer :: ierr ! return value of function + +integer :: nDimensions, nVariables, nAttributes, unlimitedDimID +integer :: StateVarID +integer :: TNVarID, TN_NMVarID, UNVarID, UN_NMVarID, VNVarID, VN_NMVarID +integer :: O1VarID, O1_NMVarID, O2VarID, O2_NMVarID, vTEC_VarID +integer :: NEVarID, OPVarID, F107VarID, ZGVarID + +type(model_type):: var + +if ( .not. module_initialized ) call static_init_model + +!------------------------------------------------------------------------------- +! make sure ncFileID refers to an open netCDF file, +!------------------------------------------------------------------------------- + +ierr = -1 ! assume things go poorly + +call nc_check(nf90_Inquire(ncFileID, nDimensions, nVariables, & + nAttributes, unlimitedDimID), 'nc_write_model_vars', 'inquire') + +if ( output_state_vector ) then + + call nc_check(NF90_inq_varid(ncFileID, 'state', StateVarID), & + 'nc_write_model_vars', 'state inq_varid' ) + call nc_check(NF90_put_var(ncFileID, StateVarID, statevec, & + start=(/ 1, copyindex, timeindex /)), & + 'nc_write_model_vars', 'state put_var') + +else + + !---------------------------------------------------------------------------- + ! We need to process the prognostic variables. + !---------------------------------------------------------------------------- + + ! This block is a stub for something more complicated. + ! Usually, the control for the execution of this block is a namelist variable. + ! Take a peek at the bgrid model_mod.f90 for a (rather complicated) example. + ! + ! Generally, it is necessary to take the statevec and decompose it into + ! the separate prognostic variables. In this (commented out) example, + ! global_Var is a user-defined type that has components like: + ! global_Var%ps, global_Var%t, ... etc. Each of those can then be passed + ! directly to the netcdf put_var routine. This may cause a huge storage + ! hit, so large models may want to avoid the duplication if possible. + + call init_model_instance(var) + call vector_to_prog_var(statevec, var) + + ! the 'start' array is crucial. In the following example, 'ps' is a 2D + ! array, and the netCDF variable "ps" is a 4D array [lat,lon,copy,time] + ! + ! call check(NF90_inq_varid(ncFileID, "ps", psVarID), "ps inq_varid") + ! call check(nf90_put_var( ncFileID, psVarID, global_Var%ps, & + ! start=(/ 1, 1, copyindex, timeindex /) ), "ps put_var") + + if (state_num_1d > 0) then + call nc_check(NF90_inq_varid(ncFileID, 'F107', F107VarID), & + 'nc_write_model_vars', 'F107 inq_varid') + call nc_check(nf90_put_var( ncFileID, F107VarID, var%vars_1d(1), & + start=(/ 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'F107 put_var') + endif + + call nc_check(NF90_inq_varid(ncFileID, 'ZG', ZGVarID), & + 'nc_write_model_vars', 'ZG inq_varid') + call nc_check(nf90_put_var( ncFileID, ZGVarID, & + var%vars_3d(:,:,:,TYPE_local_ZG+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'ZG put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'TN', TNVarID), & + 'nc_write_model_vars', 'TN inq_varid') + call nc_check(nf90_put_var( ncFileID, TNVarID, & + var%vars_3d(:,:,:,TYPE_local_TN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'TN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'TN_NM', TN_NMVarID), & + 'nc_write_model_vars', 'TN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, TN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_TN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'TN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O1', O1VarID), & + 'nc_write_model_vars', 'O1 inq_varid') + call nc_check(nf90_put_var( ncFileID, O1VarID, & + var%vars_3d(:,:,:,TYPE_local_O1+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O1 put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O1_NM', O1_NMVarID), & + 'nc_write_model_vars', 'O1_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, O1_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_O1_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O1_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O2', O2VarID), & + 'nc_write_model_vars', 'O2 inq_varid') + call nc_check(nf90_put_var( ncFileID, O2VarID, & + var%vars_3d(:,:,:,TYPE_local_O2+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O2 put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'O2_NM', O2_NMVarID), & + 'nc_write_model_vars', 'O2_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, O2_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_O2_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'O2_NM put_var') + + if (include_vTEC) then + call nc_check(NF90_inq_varid(ncFileID, 'vTEC', vTEC_VarID), & + 'nc_write_model_vars', 'vTEC inq_varid') + call nc_check(nf90_put_var( ncFileID, vTEC_VarID, & + var%vars_2d(:,:,TYPE_local_2D_TEC+1), & + start=(/ 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'vTEC put_var') + endif + + + + if (.not. only_neutral_density) then + call nc_check(NF90_inq_varid(ncFileID, 'UN', UNVarID), & + 'nc_write_model_vars', 'UN inq_varid') + call nc_check(nf90_put_var( ncFileID, UNVarID, & + var%vars_3d(:,:,:,TYPE_local_UN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'UN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'UN_NM', UN_NMVarID), & + 'nc_write_model_vars', 'UN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, UN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_UN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'UN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'VN', VNVarID), & + 'nc_write_model_vars', 'VN inq_varid') + call nc_check(nf90_put_var( ncFileID, VNVarID, & + var%vars_3d(:,:,:,TYPE_local_VN+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'VN put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'VN_NM', VN_NMVarID), & + 'nc_write_model_vars', 'VN_NM inq_varid') + call nc_check(nf90_put_var( ncFileID, VN_NMVarID, & + var%vars_3d(:,:,:,TYPE_local_VN_NM+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'VN_NM put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'OP', OPVarID), & + 'nc_write_model_vars', 'OP inq_varid') + call nc_check(nf90_put_var( ncFileID, OPVarID, & + var%vars_3d(:,:,:,TYPE_local_OP+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'OP put_var') + + call nc_check(NF90_inq_varid(ncFileID, 'NE', NEVarID), & + 'nc_write_model_vars', 'NE inq_varid') + call nc_check(nf90_put_var( ncFileID, NEVarID, & + var%vars_3d(:,:,:,TYPE_local_NE+1), & + start=(/ 1, 1, 1, copyindex, timeindex /) ), & + 'nc_write_model_vars', 'NE put_var') + + endif !(.not. only_neutral_density) +endif + +!------------------------------------------------------------------------------- +! Flush the buffer and leave netCDF file open +!------------------------------------------------------------------------------- + +if (do_output()) write (*,*) 'nc_write_model_vars: Finished filling variables ' +call nc_check(nf90_sync(ncFileID), 'nc_write_model_vars', 'sync') +if (do_output()) write (*,*) 'nc_write_model_vars: netCDF file is synched ' + +ierr = 0 ! If we got here, things went well. + +call end_model_instance(Var) ! should avoid any memory leaking + +end function nc_write_model_vars + + + +subroutine pert_model_state(state, pert_state, interf_provided) +!------------------------------------------------------------------ +! +! Perturbs a model state for generating initial ensembles. +! The perturbed state is returned in pert_state. +! A model may choose to provide a NULL INTERFACE by returning +! .false. for the interf_provided argument. This indicates to +! the filter that if it needs to generate perturbed states, it +! may do so by adding an O(0.1) magnitude perturbation to each +! model state variable independently. The interf_provided argument +! should be returned as .true. if the model wants to do its own +! perturbing of states. + +real(r8), intent(in) :: state(:) +real(r8), intent(out) :: pert_state(:) +logical, intent(out) :: interf_provided + +integer :: i, variable_type +type(location_type) :: temp_loc + +if ( .not. module_initialized ) call static_init_model + +! An interface is provided +interf_provided = .true. + +! If first call initialize random sequence +! CAUTION: my_task_id is NOT emsemble member number +! For example, my_task_id will be in [0,N-1] +! if a single instance of the model using N MPI tasks. + +if(first_pert_call) then + call init_random_seq(random_seq,my_task_id()) + first_pert_call = .false. +endif + +do i = 1, get_model_size() + call get_state_meta_data(i, temp_loc, variable_type) + if(variable_type == KIND_1D_PARAMETER) then + pert_state(i) = random_gaussian(random_seq,state(i),20.0_r8) + else + pert_state(i) = state(i) + endif +end do + +end subroutine pert_model_state + + + +subroutine prog_var_to_vector(var, x) +!======================================================================= +! +! Copies fields to straight vector +! + +type(model_type), intent(in) :: var +real(r8), intent(out) :: x(:) + +integer :: i, j, k, nf, indx + +if ( .not. module_initialized ) call static_init_model + +indx = 0 + +!3D fields +loop_longitude: do i = 1, nlon + loop_latitude: do j = 1, nlat + loop_level: do k = 1, nlev + loop_var: do nf = 1, state_num_3d + indx = indx + 1 + x(indx) = var%vars_3d(i,j,k,nf) + enddo loop_var + enddo loop_level + enddo loop_latitude + enddo loop_longitude + + +!2D fields +loop_longitude_2d: do i = 1, nlon + loop_latitude_2d: do j = 1, nlat + loop_var_2d: do nf = 1, state_num_2d + indx = indx + 1 + x(indx) = var%vars_2d(i,j,nf) + enddo loop_var_2d + enddo loop_latitude_2d + enddo loop_longitude_2d + +!1D vector +loop_1d_var: do nf = 1, state_num_1d + indx = indx + 1 + x(indx) = var%vars_1d(nf) +enddo loop_1d_var + +if(indx /= model_size) then + write(msgstring, *) 'indx ',indx,' model_size ',model_size,' must be equal ' + call error_handler(E_ERR, 'prog_var_to_vector', msgstring, source, revision, revdate) +endif + +end subroutine prog_var_to_vector + + + +subroutine vector_to_prog_var(x, var) +!================================================================== +! +! Copies fields from straight vector +! + +real(r8), intent(in) :: x(:) +type(model_type), intent(out) :: var +integer :: i, j, k, nf, indx + +if ( .not. module_initialized ) call static_init_model + +indx = 0 + +!3D fields +loop_longitude: do i = 1, nlon + loop_latitude: do j = 1, nlat + loop_level: do k = 1, nlev + loop_var: do nf = 1, state_num_3d + indx = indx + 1 + + !for O&O2 ratio + if(nf==4 .or. nf==5 .or. nf==6 .or. nf==7) then + if(x(indx)<0) then + var%vars_3d(i,j,k,nf) = 0.00001 + elseif(x(indx)>1) then + var%vars_3d(i,j,k,nf) = 0.98888 + else + var%vars_3d(i,j,k,nf) = x(indx) + endif + + ! for NE & OP + elseif ((nf==12 .or. nf==13) .and. x(indx)<1) then + var%vars_3d(i,j,k,nf) = 1 + + ! for other variables + else + var%vars_3d(i,j,k,nf) = x(indx) + endif + + enddo loop_var + enddo loop_level + enddo loop_latitude + enddo loop_longitude + +!2D fields +loop_longitude_2d: do i = 1, nlon + loop_latitude_2d: do j = 1, nlat + loop_var_2d: do nf = 1, state_num_2d + indx = indx + 1 + var%vars_2d(i,j,nf) = x(indx) + enddo loop_var_2d + enddo loop_latitude_2d + enddo loop_longitude_2d + +!1D vector +loop_1d_var: do nf = 1, state_num_1d + indx = indx + 1 + var%vars_1d(nf) = x(indx) +enddo loop_1d_var + +if(indx /= model_size) then + write(msgstring, *) 'indx ',indx,' model_size ',model_size,' must be equal ' + call error_handler(E_ERR, 'vector_to_prog_var', msgstring, source, revision, revdate) +endif + +end subroutine vector_to_prog_var + + +subroutine init_model_instance(var,valid_time) +!================================================================== +! +! Initializes an instance of TIEGCM model state variables +! + +type(model_type), intent(out) :: var +type(time_type), optional, intent(in) :: valid_time + +if ( .not. module_initialized ) call static_init_model + +allocate(var%vars_3d(nlon, nlat, nlev, state_num_3d)) + +if (state_num_2d > 0) then + allocate(var%vars_2d(nlon, nlat, state_num_2d)) +endif + +if (state_num_1d > 0) then + allocate(var%vars_1d(state_num_1d)) +endif + +if (present(valid_time)) then + var%valid_time = valid_time +else + var%valid_time = set_time_missing() +endif + +end subroutine init_model_instance + + + +subroutine end_model_instance(var) +!================================================================== +! +! Ends an instance of TIEGCM model state variables +! + +type(model_type), intent(inout) :: var + +if ( .not. module_initialized ) call static_init_model + +deallocate(var%vars_3d) +if (state_num_2d > 0) deallocate(var%vars_2d) +if (state_num_1d > 0) deallocate(var%vars_1d) + +end subroutine end_model_instance + + + +subroutine update_TIEGCM_restart(file_name, var) +!======================================================================= +! +! Updates TIEGCM restart file fields +! + + character (len = *), intent(in) :: file_name + type(model_type), intent(in) :: var + + integer :: ncerr + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_id + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: utsec, doy !year + + real(r8), dimension(nlon,nlat,nlev) :: TN, TN_NM, UN, UN_NM, VN, VN_NM + real(r8), dimension(nlon,nlat,nlev) :: O1, O1_NM, O2, O2_NM, OP + real(r8), dimension(nlon,nlat,nilev):: NE + + integer :: nlevm1 + type(time_type) :: jan1, tbase + integer :: year, month, day, hour, mins, sec + + if ( .not. module_initialized ) call static_init_model + + nlevm1 = nlev -1 + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + if (do_output()) print *, 'update_TIEGCM_restart: opening restart' + ncerr = nf90_open( file_name, NF90_WRITE, restart_id )! open with read/write access + call nc_check(ncerr, 'update_TIEGCM_restart','open') ! will die if error + if (do_output()) print *, 'update_TIEGCM_restart: opened with '//trim(nf90_strerror(ncerr)) + + + !... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'lev', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid lev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension lev') + if (dim_len .ne. nlev) then + write(msgstring, *) trim(file_name), ' dim_lev = ',dim_len, ' DART expects ',nlev + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'update_TIEGCM_restart', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'update_TIEGCM_restart', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'update_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + + call nc_check( nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'update_TIEGCM_restart', 'inquire id of unlimited dimension time') + call nc_check( nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'update_TIEGCM_restart', 'inquire_dimension time') + + +!... put variables into TIEGCM array + + TN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_TN+1) + TN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + TN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_TN_NM+1) + TN_NM(:,:, nlev ) = TIEGCM_missing_value !fill top slot with missing value + + O1 = var%vars_3d(:,:,:,TYPE_local_O1+1) + O1_NM = var%vars_3d(:,:,:,TYPE_local_O1_NM+1) + O2 = var%vars_3d(:,:,:,TYPE_local_O2+1) + O2_NM = var%vars_3d(:,:,:,TYPE_local_O2_NM+1) + + if (.not. only_neutral_density) then + UN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_UN+1) + UN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + UN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_UN_NM+1) + UN_NM(:,:,nlev) = TIEGCM_missing_value !fill top slot with missing value + + VN(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_VN+1) + VN(:,:, nlev) = TIEGCM_missing_value !fill top slot with missing value + + VN_NM(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_VN_NM+1) + VN_NM(:,:,nlev) = TIEGCM_missing_value !fill top slot with missing value + + OP(:,:,1:nlevm1) = var%vars_3d(:,:,1:nlevm1,TYPE_local_OP+1) + OP(:,:,nlev) = TIEGCM_missing_value !fill top slot with missing value + + NE = var%vars_3d(:,:,:,TYPE_local_NE+1) + endif ! (.not. only_neutral_density) + + + call nc_check( nf90_inq_varid(restart_id, 'TN', var_id), & + 'update_TIEGCM_restart', 'inq_varid TN') + call nc_check( nf90_put_var(restart_id, var_id, values=TN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var TN') + + + call nc_check( nf90_inq_varid(restart_id, 'TN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid TN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=TN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var TN_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'O1', var_id), & + 'update_TIEGCM_restart', 'inq_varid O1') + call nc_check( nf90_put_var(restart_id, var_id, values=O1, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O1') + + + call nc_check( nf90_inq_varid(restart_id, 'O1_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid O1_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=O1_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O1_NM') + + + call nc_check( nf90_inq_varid(restart_id, 'O2', var_id), & + 'update_TIEGCM_restart', 'inq_varid O2') + call nc_check( nf90_put_var(restart_id, var_id, values=O2, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O2') + + + call nc_check( nf90_inq_varid(restart_id, 'O2_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid O2_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=O2_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var O2_NM') + + if (.not. only_neutral_density) then + call nc_check( nf90_inq_varid(restart_id, 'UN', var_id), & + 'update_TIEGCM_restart', 'inq_varid UN') + call nc_check( nf90_put_var(restart_id, var_id, values=UN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var UN') + + + call nc_check( nf90_inq_varid(restart_id, 'UN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid UN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=UN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var UN_NM') + + call nc_check( nf90_inq_varid(restart_id, 'VN', var_id), & + 'update_TIEGCM_restart', 'inq_varid VN') + call nc_check( nf90_put_var(restart_id, var_id, values=VN, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var VN') + + call nc_check( nf90_inq_varid(restart_id, 'VN_NM', var_id), & + 'update_TIEGCM_restart', 'inq_varid VN_NM') + call nc_check( nf90_put_var(restart_id, var_id, values=VN_NM, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nlev,1/)), & + 'update_TIEGCM_restart', 'put_var VN_NM') + + call nc_check( nf90_inq_varid(restart_id, 'OP', var_id), & + 'update_TIEGCM_restart', 'inq_varid OP') + call nc_check( nf90_put_var(restart_id, var_id, values=OP, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nilev,1/)), & + 'update_TIEGCM_restart', 'put_var OP') + + call nc_check( nf90_inq_varid(restart_id, 'NE', var_id), & + 'update_TIEGCM_restart', 'inq_varid NE') + call nc_check( nf90_put_var(restart_id, var_id, values=NE, & + start = (/1,1,1,dim_time_len/), count = (/nlon,nlat,nilev,1/)), & + 'update_TIEGCM_restart', 'put_var NE') + + endif ! (.not. only_neutral_density) + +!... mtime and year + call get_date(var%valid_time, year, month, day, hour, mins, sec ) + jan1 = set_date(year,1,1) + tbase = var%valid_time - jan1 ! total time since the start of the year. + + call get_time(tbase, utsec, doy) + + mtime(1) = doy + 1 ! Have to add January 1 back in + mtime(2) = hour + mtime(3) = mins + + if (do_output()) print *, 'update_TIEGCM_restart: mtime (doy/hour/minute):', mtime + call nc_check( nf90_inq_varid(restart_id, 'mtime', var_id), & + 'update_TIEGCM_restart','inq_varid mtime') + call nc_check( nf90_put_var( restart_id, var_id, values=mtime, & + start = (/1,dim_time_len/), count = (/nmtime,1/)), & + 'update_TIEGCM_restart','get_var mtime') + + if (do_output()) print *, 'update_TIEGCM_restart: year:', year + call nc_check( nf90_inq_varid(restart_id, 'year', var_id), & + 'update_TIEGCM_restart','inq_varid year') + call nc_check( nf90_put_var( restart_id, var_id, values=year, & + start = (/dim_time_len/)) , & + 'update_TIEGCM_restart','get_var year') + + call nc_check( nf90_sync(restart_id), 'update_TIEGCM_restart', 'sync') + + call nc_check( nf90_close(restart_id), 'update_TIEGCM_restart', 'close') + +end subroutine update_TIEGCM_restart + + + +subroutine read_TIEGCM_restart(file_name, var, model_time) +!======================================================================= +! +! Read TIEGCM restart file fields +! + + character (len = *), intent(in) :: file_name + type(model_type), intent(out):: var + type(time_type), intent(out):: model_time + + integer :: ncerr + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_Vtmp_id, var_mtime_id, var_year_id + real(r8), dimension(nlon,nlat,nlev) :: TN, TN_NM, UN, UN_NM, VN, VN_NM + real(r8), dimension(nlon,nlat,nlev) :: O1, O1_NM, O2, O2_NM + real(r8), dimension(nlon,nlat,nlev) :: TI, TE, OP + real(r8), dimension(nlon,nlat,nilev) :: NE, NEm, Z, ZGG + integer :: nlev10 + real(r8), dimension(nlon,nlat,nlev+10) :: ZGG_extended, NEm_extended !nlev10 + real(r8), dimension(nlon,nlat) :: vTEC, Tplasma, Hplasma, GRAVITYtop + real(r8), dimension(nlev+9) :: delta_ZGG, NEm_middle !nlev10-1 + real(r8), parameter :: k_constant = 1.381e-23_r8 ! m^2 * kg / s^2 / K + real(r8), parameter :: omass = 2.678e-26_r8 ! mass of atomic oxgen kg + real(r8) :: earth_radiusm + integer, dimension(:), allocatable :: yeartmp + integer, dimension(:,:), allocatable :: mtimetmp + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: year, utsec, doy + integer :: nlevm1 + integer :: j, k + + if ( .not. module_initialized ) call static_init_model + + nlevm1 = nlev - 1 + + if( .not. file_exist(file_name)) then + write(msgstring,*)trim(file_name)//' does not exist.' + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_restart:reading restart:', file_name + + call nc_check( nf90_open( file_name, NF90_NOWRITE, restart_id ), & + 'read_TIEGCM_restart', 'open') + +!... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lev', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid lev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension lev') + if (dim_len .ne. nlev) then + write(msgstring, *) trim(file_name), ' dim_lev = ',dim_len, ' DART expects ',nlev + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_restart', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_restart', 'inquire_dimension time') + + +!... TN + call nc_check(nf90_inq_varid(restart_id, 'TN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TN') + +!... TN_NM + call nc_check(nf90_inq_varid(restart_id, 'TN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TN_NM') + +!... O1 + call nc_check(nf90_inq_varid(restart_id, 'O1', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O1') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O1, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O1') + +!... O1_NM + call nc_check(nf90_inq_varid(restart_id, 'O1_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O1_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O1_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O1_NM') + +!... O2 + call nc_check(nf90_inq_varid(restart_id, 'O2', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O2') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O2, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O2') + +!... O2_NM + call nc_check(nf90_inq_varid(restart_id, 'O2_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid O2_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=O2_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var O2_NM') + + if (.not. only_neutral_density) then +!... UN + call nc_check(nf90_inq_varid(restart_id, 'UN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid UN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=UN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var UN') + +!... UN_NM + call nc_check(nf90_inq_varid(restart_id, 'UN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid UN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=UN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var UN_NM') + +!... VN + call nc_check(nf90_inq_varid(restart_id, 'VN', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid VN') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=VN, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var VN') + +!... VN_NM + call nc_check(nf90_inq_varid(restart_id, 'VN_NM', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid VN_NM') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=VN_NM, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var VN_NM') + +!... OP + call nc_check(nf90_inq_varid(restart_id, 'OP', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid OP') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=OP, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var OP') + +!... NE + call nc_check(nf90_inq_varid(restart_id, 'NE', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid NE') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=NE, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_restart', 'get_var NE') + + endif ! (.not. only_neutral_density) + + + if (include_vTEC) then + + if (only_neutral_density) then +!... NE + call nc_check(nf90_inq_varid(restart_id, 'NE', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid NE') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=NE, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_restart', 'get_var NE') + endif ! (only_neutral_density) + +!... TI (midpoints) + call nc_check(nf90_inq_varid(restart_id, 'TI', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TI') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TI, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TI') + +!... TE (midpoints) + call nc_check(nf90_inq_varid(restart_id, 'TE', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid TE') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=TE, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var TE') + +!... OP (midpoints) + call nc_check(nf90_inq_varid(restart_id, 'OP', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid OP') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=OP, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nlev, 1 /)), & + 'read_TIEGCM_restart', 'get_var OP') + + +!... Z (interfaces) + call nc_check(nf90_inq_varid(restart_id, 'Z', var_Vtmp_id), & + 'read_TIEGCM_restart', 'inq_varid Z') + call nc_check(nf90_get_var(restart_id, var_Vtmp_id, values=Z, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_restart', 'get_var Z') + +!... vTEC + + ! Convert Z (geopotential height) in cm to m + Z = Z * 1.0e-2_r8 + ! Convert earth_radius in km to m + earth_radiusm = earth_radius * 1000.0_r8 + ! Convert to geometric height from geopotential height + ZGG = (earth_radiusm*Z) / (earth_radiusm - Z) + ! Convert NE in #/cm^3 to #/m^3 + NEm = NE * 1.0e+6 + ! Gravity at the top layer + GRAVITYtop(:,:) = gravity * (earth_radiusm / (earth_radiusm + ZGG(:,:,nilev))) ** 2 + ! Plasma Temperature + Tplasma(:,:) = (TI(:,:,nlev-1) + TE(:,:,nlev-1)) / 2.0_r8 + ! Compute plasma scale height + Hplasma = (2.0_r8 * k_constant / omass ) * Tplasma / GRAVITYtop + ! NE is extrapolated to 10 more layers + nlev10 = nlev + 10 + ZGG_extended(:,:,1:nlev) = ZGG + NEm_extended(:,:,1:nlev) = NEm + do j = nlev, nlev10 + NEm_extended(:,:,j) = 2.0_r8 * NEm_extended(:,:,j-1) * exp(-1.0_r8) + ZGG_extended(:,:,j) = ZGG_extended(:,:,j-1) + Hplasma(:,:) / 2.0_r8 + enddo + + do k = 1, nlon + do j = 1, nlat + delta_ZGG(1:(nlev10-1)) = ZGG_extended(k,j,2:nlev10)-ZGG_extended(k,j,1:(nlev10-1)) + NEm_middle(1:(nlev10-1))= NEm_extended(k,j,2:nlev10)+NEm_extended(k,j,1:(nlev10-1))/2.0_r8 + vTEC(k,j) = sum(NEm_middle * delta_ZGG) * 1.0e-16 ! Convert to TECU (1.0e+16 #/m^2) + enddo + enddo + + endif ! (include_vTEC) + + +!... get mtime + call nc_check(nf90_inq_dimid(restart_id, 'mtimedim', dim_id), & + 'read_TIEGCM_restart', 'inq_dimid mtimedim') + call nc_check(nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_restart', 'inquire_dimension mtimedim') + if (dim_len .ne. nmtime) then + write(msgstring, *) trim(file_name), ' mtimedim = ',dim_len, ' DART expects ', nmtime + call error_handler(E_ERR,'read_TIEGCM_restart',msgstring,source,revision,revdate) + endif + + allocate(mtimetmp(dim_len, dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'mtime', var_mtime_id), & + 'read_TIEGCM_restart', 'inq_varid mtime') + call nc_check(nf90_get_var(restart_id, var_mtime_id, values=mtimetmp), & + 'read_TIEGCM_restart', 'get_var mtime') + mtime = mtimetmp(:,dim_time_len) + deallocate(mtimetmp) + +!... get year + allocate(yeartmp(dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'year', var_year_id), & + 'read_TIEGCM_restart', 'inq_varid year') + call nc_check(nf90_get_var(restart_id, var_year_id, values=yeartmp), & + 'read_TIEGCM_restart', 'get_var year') + year = yeartmp(dim_time_len) + deallocate(yeartmp) + +!... close the file + call nc_check(nf90_close( restart_id),'read_TIEGCM_restart','close') + +!... Now we want to convert the year/doy/hour/minute to a dart time. +!... We start by finding the dart time of the year and adding the rest to it. + + if (do_output()) print *, 'read_TIEGCM_restart: mtime (doy/hour/minute) and year:', mtime, year + + doy = mtime(1) + utsec = (mtime(2)*60 + mtime(3))*60 + + model_time = set_time(utsec, doy-1) + set_date(year, 1, 1) ! Jan 1 of whatever year. + + var%valid_time = model_time + + if (do_output()) call print_time(model_time, str=" read_TIEGCM_restart: model_time ") + if (do_output()) call print_date(model_time, str=" read_TIEGCM_restart: model_date ") + +!... fill DART state vector with TIEGCM variables + + var%vars_3d(:,:,1:nlevm1,TYPE_local_TN+1) = TN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_TN+1) = TN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_TN_NM+1) = TN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_TN_NM+1) = TN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,:,TYPE_local_O1+1) = O1 + var%vars_3d(:,:,:,TYPE_local_O1_NM+1) = O1_NM + + var%vars_3d(:,:,:,TYPE_local_O2+1) = O2 + var%vars_3d(:,:,:,TYPE_local_O2_NM+1) = O2_NM + + if (.not. only_neutral_density) then + var%vars_3d(:,:,1:nlevm1,TYPE_local_UN+1) = UN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_UN+1) = UN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_UN_NM+1) = UN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_UN_NM+1) = UN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_VN+1) = VN(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_VN+1) = VN(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_VN_NM+1) = VN_NM(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_VN_NM+1) = VN_NM(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,1:nlevm1,TYPE_local_OP+1) = OP(:,:,1:nlevm1) + var%vars_3d(:,:, nlev,TYPE_local_OP+1) = OP(:,:, nlevm1) !fill top slot with values at nlev-1 + + var%vars_3d(:,:,:,TYPE_local_NE+1) = NE(:,:,:) + endif ! (.not. only_neutral_density) + + if (include_vTEC) then + var%vars_2d(:,:,TYPE_local_2D_TEC+1) = vTEC + endif ! (include_vTEC) + +end subroutine read_TIEGCM_restart + + + +subroutine read_TIEGCM_definition(file_name) +!======================================================================= +! +! Read TIEGCM grid definition and Geopotential from a tiegcm restart file +! + + character (len = *), intent(in) :: file_name + integer :: ncerr + integer :: restart_id + integer :: var_lon_id, var_lat_id, var_lev_id, var_ilev_id + integer :: dim_lon_id, dim_lat_id, dim_lev_id, dim_ilev_id + integer :: dim_id, dim_len, var_mtime_id + integer :: dim_time_id, dim_time_len, missing_value_len + integer :: var_p0_id + integer :: l + real(r8) :: p0, lon_tmp + integer, dimension(:,:), allocatable :: mtimetmp + integer, parameter :: nmtime = 3 + integer, dimension(nmtime) :: mtime ! day, hour, minute + integer :: utsec, doy + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_definition:reading restart:', file_name + ncerr = nf90_open(file_name, NF90_NOWRITE, restart_id) + call nc_check(ncerr, 'read_TIEGCM_definition', 'open') + if (do_output()) print *, 'read_TIEGCM_definition:opened with '//trim(nf90_strerror(ncerr)) + + call nc_check(nf90_inq_dimid(restart_id, 'lon', dim_lon_id), & + 'read_TIEGCM_definition', 'inq_dimid lon') + call nc_check(nf90_inquire_dimension(restart_id, dim_lon_id, len=nlon), & + 'read_TIEGCM_definition', 'inquire_dimension lon') + allocate(lons(nlon)) + call nc_check(nf90_inq_varid(restart_id, 'lon', var_lon_id), & + 'read_TIEGCM_definition', 'inq_varid lon') + call nc_check(nf90_get_var(restart_id, var_lon_id, values=lons), & + 'read_TIEGCM_definition', 'get_var lon') + + do l = 1, nlon + lon_tmp = lons(l) + if (lon_tmp < 0) lons(l) = lons(l) + 360 ! DART [0, 360] TIEGCM [-180, 180] + enddo + + call nc_check(nf90_inq_dimid(restart_id, 'lat', dim_lat_id), & + 'read_TIEGCM_definition', 'inq_dimid lat') + call nc_check(nf90_inquire_dimension(restart_id, dim_lat_id, len=nlat), & + 'read_TIEGCM_definition', 'inquire_dimension lat') + allocate(lats(nlat)) + call nc_check(nf90_inq_varid(restart_id, 'lat', var_lat_id), & + 'read_TIEGCM_definition', 'inq_varid lat') + call nc_check(nf90_get_var(restart_id, var_lat_id, values=lats), & + 'read_TIEGCM_definition', 'get_var lat') + + call nc_check(nf90_inq_varid(restart_id, 'p0', var_p0_id), & + 'read_TIEGCM_definition', 'inq_varid p0') + call nc_check(nf90_get_var(restart_id, var_p0_id, values=p0), & + 'read_TIEGCM_definition', 'get_var p0') + + TIEGCM_reference_pressure = p0 + + call nc_check(nf90_inq_dimid(restart_id, 'lev', dim_lev_id), & + 'read_TIEGCM_definition', 'inq_dimid lev') + call nc_check(nf90_inquire_dimension(restart_id, dim_lev_id, len=nlev), & + 'read_TIEGCM_definition', 'inquire_dimension lev') + allocate(levs(nlev)) + allocate(plevs(nlev)) + call nc_check(nf90_inq_varid(restart_id, 'lev', var_lev_id), & + 'read_TIEGCM_definition', 'inq_varid lev') + call nc_check(nf90_get_var(restart_id, var_lev_id, values=levs), & + 'read_TIEGCM_definition', 'get_var lev') + + plevs = p0 * exp(-levs) * 100.0_r8 ![Pa] = 100* [millibars] = 100* [hPa] + + call nc_check(nf90_inq_dimid(restart_id, 'ilev', dim_ilev_id), & + 'read_TIEGCM_definition', 'inq_dimid ilev') + call nc_check(nf90_inquire_dimension(restart_id, dim_ilev_id, len=nilev), & + 'read_TIEGCM_definition', 'inquire_dimension ilev') + allocate(ilevs(nilev)) + allocate(pilevs(nilev)) + call nc_check(nf90_inq_varid(restart_id, 'ilev', var_ilev_id), & + 'read_TIEGCM_definition', 'inq_varid ilev') + call nc_check(nf90_get_var(restart_id, var_ilev_id, values=ilevs), & + 'read_TIEGCM_definition', 'get_var ilev') + + pilevs = p0 * exp(-ilevs) * 100.0_r8 ! [Pa] = 100* [millibars] = 100* [hPa] + + if (nlev .ne. nilev) then + write(msgstring, *) ' nlev = ',nlev,' nilev = ',nilev, 'are different; DART assumes them to be the same' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire_attribute(restart_id, nf90_global, 'missing_value', len = missing_value_len), & + 'read_TIEGCM_definition', 'inquire global attribute named missing_value') + if (missing_value_len .ne. 1) then + write(msgstring, *) ' global attribute missing_value length is ', missing_value_len, ' DART expects 1' + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_get_att(restart_id, nf90_global, 'missing_value', TIEGCM_missing_value), & + 'read_TIEGCM_definition', 'get_att global attribute named missing_value') + +!... get mtime + call nc_check(nf90_inq_dimid(restart_id, 'mtimedim', dim_id), & + 'read_TIEGCM_definition', 'inq_dimid mtimedim') + call nc_check(nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_definition', 'inquire_dimension mtimedim') + if (dim_len .ne. nmtime) then + write(msgstring, *) trim(file_name), ' mtimedim = ',dim_len, ' DART expects ', nmtime + call error_handler(E_ERR,'read_TIEGCM_definition',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_definition', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_definition', 'inquire_dimension time') + + allocate(mtimetmp(dim_len, dim_time_len)) + call nc_check(nf90_inq_varid(restart_id, 'mtime', var_mtime_id), & + 'read_TIEGCM_definition', 'inq_varid mtime') + call nc_check(nf90_get_var(restart_id, var_mtime_id, values=mtimetmp), & + 'read_TIEGCM_definition', 'get_var mtime') + mtime = mtimetmp(:,dim_time_len) + deallocate(mtimetmp) + + call nc_check(nf90_close(restart_id),'read_TIEGCM_definition', 'close') + + if (do_output()) print *, 'read_TIEGCM_definition: mtime (doy/hour/minute):', mtime + doy = mtime(1) + utsec = (mtime(2)*60 + mtime(3))*60 + +end subroutine read_TIEGCM_definition + + + +subroutine read_TIEGCM_secondary(file_name, var) +!======================================================================= +! +! Read TIEGCM Geopotential from a tiegcm secondary output file +! + + character (len = *), intent(in):: file_name + type(model_type), intent(out):: var + integer :: restart_id + integer :: dim_id, dim_len + integer :: dim_time_id, dim_time_len + integer :: var_ZGtmp_id + real(r8), dimension(nlon,nlat,nilev) :: ZG + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_secondary:reading restart:', file_name + + call nc_check(nf90_open(file_name, NF90_NOWRITE, restart_id), & + 'read_TIEGCM_secondary', 'open') + +!... check for matching dimensions + call nc_check( nf90_inq_dimid(restart_id, 'lon', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid lon') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension lon') + if (dim_len .ne. nlon) then + write(msgstring, *) trim(file_name), ' dim_lon = ',dim_len, ' DART expects ',nlon + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'lat', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid lat') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension lat') + if (dim_len .ne. nlat) then + write(msgstring, *) trim(file_name), ' dim_lat = ',dim_len, ' DART expects ',nlat + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check( nf90_inq_dimid(restart_id, 'ilev', dim_id), & + 'read_TIEGCM_secondary', 'inq_dimid ilev') + call nc_check( nf90_inquire_dimension(restart_id, dim_id, len=dim_len), & + 'read_TIEGCM_secondary', 'inquire_dimension ilev') + if (dim_len .ne. nilev) then + write(msgstring, *) trim(file_name), ' dim_ilev = ',dim_len, ' DART expects ',nilev + call error_handler(E_ERR,'read_TIEGCM_secondary',msgstring,source,revision,revdate) + endif + + call nc_check(nf90_inquire(restart_id, unlimitedDimId = dim_time_id), & + 'read_TIEGCM_secondary', 'inquire id of unlimited dimension time') + call nc_check(nf90_inquire_dimension(restart_id, dim_time_id, len=dim_time_len ), & + 'read_TIEGCM_secondary', 'inquire_dimension time') + + call nc_check(nf90_inq_varid(restart_id, 'ZG', var_ZGtmp_id), & + 'read_TIEGCM_secondary', 'inq_varid ZG') + call nc_check(nf90_get_var(restart_id, var_ZGtmp_id, values=ZG, & + start = (/ 1, 1, 1, dim_time_len /), & + count = (/ nlon, nlat, nilev, 1 /)), & + 'read_TIEGCM_secondary', 'get_var ZG') + + call nc_check(nf90_close(restart_id),'read_TIEGCM_secondary', 'close') + + var%vars_3d(:,:,:,TYPE_local_ZG+1) = ZG(:,:,:) ![cm] + +end subroutine read_TIEGCM_secondary + + +subroutine read_TIEGCM_namelist(file_name,var) +!======================================================================= +! +! Read in TIEGCM namelist input +! + character (len = *), intent(in) :: file_name + type(model_type), optional, intent(out) :: var + integer :: iunit, io + integer :: daysec = 86400 + +!---------------------------------------------------------------------------------- +! 1/3/2011, the namelist definition taken from $TGCMROOT/tiegcm1.93/src/input.F +! the following parameter values are from params.F +! modify the namelist definition for future tiegcm updates +! + integer,parameter :: mxind_time = 500 ! max number of time-dependent solar index points + integer,parameter :: mxhvols = 100 ! max number of output history file + integer,parameter :: mxseries = 10 ! max number of time series for primary histories + integer,parameter :: mxfsech = 100 ! max number of fields on secondary histories +! +! Namelist user input variables: +! + character(len=80)::& + & label, &! optional generic text label for this run + & tempdir, &! temporary directory + & magvol, &! file name or mss path to magnetic data file + & amievol ! file or mss path of amie data file (optional) +! +! date and calday are no longer supported, and are replaced by start_day, +! start_year, and calendar_advance. Date and calday are retained here so +! error usage statements can be issued if user sets one of them. +! + integer :: & + & start_day, &! starting day of year (integer 0->365) + & start_year, &! starting year (4-digit integer yyyy) + & calendar_advance,&! if > 0, advance calendar day from start_day + & date(3), &! old: model starting year, day ( 2 ints yyyy,dd) + & calday, &! old: starting calendar day (0-mxday) + & mxday, &! calendar day (0-mxday) + & step, &! model time step (integer seconds) + & dispose, &! dispose output files to mss if dispose==1 or 2 + & eddy_dif, &! 0/1 flag for DOY dependent eddy diffusion (difk, dift, xmue) + & dynamo, &! 0/1 flag for dynamo + & tideann, &! 0/1 flag for annual tide (deprecated as of May 2008) + & aurora, &! 0/1 flag for aurora + & ntask_lat, &! number of tasks in latitude dimension + & ntask_lon ! number of tasks in longitude dimension + real :: & + & tide(10), &! semidiurnal tide amplitudes and phases + & tide2(2), &! diurnal tide amplitude and phase + & tide3m3(2), &! 2-day wave amplitude and phase + & f107, &! 10.7 cm daily solar flux + & f107a, &! 10.7 cm average (81-day) solar flux + & colfac ! collision factor +! +! Input parameters that can be either constant or time-dependent: + real :: & + & power, &! hemispheric power (gw) (hpower on histories) + & ctpoten, &! cross-cap potential (volts) + & bximf, &! BX component of IMF + & byimf, &! BY component of IMF + & bzimf, &! BZ component of IMF in nT + & swvel, &! Solar wind velocity in km/s + & swden, &! Solar wind density in #/cm3 + & al, &! AL lower magnetic auroral activity index in nT + & kp ! Kp index + real,dimension(4,mxind_time) :: power_time,ctpoten_time, & + & bximf_time,byimf_time,bzimf_time,swvel_time,swden_time,al_time, & + & kp_time + integer :: & + & ntimes_ctpoten,ntimes_power,ntimes_bximf,ntimes_byimf, & + & ntimes_bzimf,ntimes_swden,ntimes_swvel,ntimes_al,ntimes_kp + logical :: aluse ! logical to use AL in Weimer 2001 model or not +! +! Parameters as read from namelist: + real :: rd_power,rd_ctpoten,rd_f107,rd_f107a,rd_bximf,rd_byimf, & + & rd_bzimf,rd_swvel,rd_swden,rd_kp +! +! If indices_interp==1, time-dependent indices (power_time, ctpoten_time, etc) +! will be interpolated to model time, otherwise they will change only +! when the given values change. This has no effect on indices given as constants. +! + integer :: indices_interp=1 +! +! Import data file names: +! + integer,parameter :: mxlen_filename=80 + character(len=mxlen_filename) :: & +! +! 4/2/08 btf: Introducing Weimer 2005 model (wei05sc.F). +! Retain ability to call either the 2001 or 2005 weimer models +! for now, to facilitate comparison runs, so potential_model +! can be either WEIMER01 or WEIMER05. +! + & potential_model, &! electric potential model used + ! Values can be 'HEELIS', 'WEIMER', or 'NONE' + ! If absent, the default value is set to 'HEELIS' + & weimer_ncfile, &! path to netcdf weimer01 coefficients file + & wei05sc_ncfile, &! path to netcdf data files for weimer05 model + & gpi_ncfile, &! mss path or file path to netcdf gpi data file + & ncep_ncfile, &! ncep data file (time-gcm only) + & see_ncfile, &! mss path or file path to netcdf SEE flux data file + & imf_ncfile, &! mss path or disk file path to netcdf IMF data file + & gswm_mi_di_ncfile, &! gswm migrating diurnal data file + & gswm_mi_sdi_ncfile,&! gswm migrating semi-diurnal data file + & gswm_nm_di_ncfile, &! gswm non-migrating diurnal data file + & gswm_nm_sdi_ncfile,&! gswm non-migrating semi-diurnal data file + & saber_ncfile, &! SABER data (T,Z) + & tidi_ncfile ! TIDI data (U,V) +! +! integer,parameter :: ngpivars = 4 +! real :: gpi_vars(ngpivars) ! f107,f107a,power,ctpoten +! character(len=16) :: +! | gpi_names(ngpivars) ! names of gpi_vars +! +! Primary history user input (dimension parameters are in params.h): + character(len=80) :: & + & source, &! file containing source history (optional) + output(mxhvols) ! output file(s) (required) + integer :: & + & source_start(3), &! source history model time + & start(3,mxseries), &! primary history model start time(s) + & stop(3,mxseries), &! primary history model stop time(s) + & hist(3,mxseries), &! primary history disk write frequency + & save(3,mxseries), &! primary history file save frequency + & mxhist_prim, &! max number of histories per primary file + & msreten, &! retention period for history files + & noutput ! number of output files given +! +! Secondary history user input (dimension parameters are in params.h): + character(len=80) :: & + & secsource, &! file containing source sec_history (for mhd) + & secout(mxhvols) ! secondary history output file(s) + character(len=16) :: & + & secflds(mxfsech) ! secondary history output fields + integer :: & + & secstart(3,mxseries),&! secondary history model start time(s) + & secstop(3,mxseries), &! secondary history model stop time(s) + & sechist(3,mxseries), &! secondary history disk write frequency + & secsave(3,mxseries), &! secondary history file save frequency + & mxhist_sech, &! max number of histories per secondary file + & sech_nbyte ! 4 or 8: write real or double values to secondary file +! +! Namelist for read: + namelist/tgcm_input/ & + & label,tempdir,magvol,amievol,date,calday,step,dispose, & + & source,source_start,output,start,stop,hist,save, & + & secout,secstart,secstop,sechist,secsave,secflds, & + & potential_model,eddy_dif,dynamo,tide,tide2,tide3m3, & + & f107,f107a,power,ctpoten,bximf,byimf,bzimf,swvel,swden,al,& + & kp,colfac,tideann,aurora,gpi_ncfile,gswm_mi_di_ncfile, & + & gswm_mi_sdi_ncfile,gswm_nm_di_ncfile,gswm_nm_sdi_ncfile, & + & mxhist_prim,mxhist_sech,msreten,ntask_lat,ntask_lon, & + & start_day,start_year,calendar_advance,see_ncfile, & + & ctpoten_time,power_time,bximf_time,byimf_time,bzimf_time, & + & kp_time,al_time,swden_time,swvel_time,indices_interp, & + & imf_ncfile,saber_ncfile,tidi_ncfile,sech_nbyte + +!---------------------------------------------------------------------------------- + + if( .not. file_exist(file_name)) then + write(msgstring,*) trim(adjustl(file_name)),' not available.' + call error_handler(E_ERR,'read_TIEGCM_namelist',msgstring,source,revision,revdate) + endif + + if (do_output()) print *, 'read_TIEGCM_namelist: reading restart:', file_name + +!! Read the namelist entry tgcm_input from tiegcm.nml + call find_namelist_in_file("tiegcm.nml", "tgcm_input", iunit) + read(iunit, nml = tgcm_input, iostat = io) + call check_namelist_read(iunit, io, "tgcm_input") + + if (step >= daysec) then + time_step_days = int(step/daysec) + time_step_seconds = mod(step,daysec) + else + time_step_days = 0 + time_step_seconds = step + endif + + if ((state_num_1d > 0) .and. present(var)) then + var%vars_1d(1) = f107 ! f10.7 cm flux + endif + + +end subroutine read_TIEGCM_namelist + + + +subroutine ens_mean_for_model(filter_ens_mean) +!=================================================================== +! +! Not used in low-order models +! Stores provided ensemble mean within the module for later use + +real(r8), intent(in) :: filter_ens_mean(:) + +if ( .not. module_initialized ) call static_init_model + +ens_mean = filter_ens_mean + +end subroutine ens_mean_for_model + + + +subroutine get_close_obs(gc, base_obs_loc, base_obs_kind, obs_loc, obs_kind, & + num_close, close_ind, dist) +!=================================================================== +! +! Given a DART ob (referred to as "base") and a set of obs priors or +! state variables returns the subset of close ones to the "base" ob, their +! indices, and their distances to the "base" ob... + +! For vertical distance computations, general philosophy is to convert all +! vertical coordinates to a common coordinate. +! FOR NOW VERTICAL LOCALIZATION IS DONE ONLY IN HEIGHT (ZG) +! OBS VERTICAL LOCATION IS GIVEN IN HEIGHT (model_interpolate) +! STATE VERTICAL LOCATION IS GIVEN IN HEIGHT (get_state_meta_data) + +! Note that both base_obs_loc and obs_loc are intent(inout), meaning that these +! locations are possibly modified here and returned as such to the calling +! routine. The calling routine is always filter_assim and these arrays are local +! arrays within filter_assim. In other words, these modifications will only +! matter within filter_assim, but will not propagate backwards to filter. + +type(get_close_type), intent(in) :: gc +type(location_type), intent(inout) :: base_obs_loc, obs_loc(:) +integer, intent(in) :: base_obs_kind, obs_kind(:) +integer, intent(out) :: num_close, close_ind(:) +real(r8), intent(out) :: dist(:) + +integer :: k, t_ind + +call loc_get_close_obs(gc, base_obs_loc, base_obs_kind, obs_loc, obs_kind, & + num_close, close_ind, dist) + +! Localize +if (state_num_1d > 0) then + +do k = 1, num_close + + t_ind = close_ind(k) + + if ( (obs_kind(t_ind) == KIND_MOLEC_OXYGEN_MIXING_RATIO) & + .or. (obs_kind(t_ind) == KIND_U_WIND_COMPONENT) & + .or. (obs_kind(t_ind) == KIND_V_WIND_COMPONENT) & + .or. (obs_kind(t_ind) == KIND_TEMPERATURE) ) then + + !set distance to a very large value so that it won't get updated + dist(k) = 2.0_r8 * PI + + elseif (obs_kind(t_ind) == KIND_1D_PARAMETER) then + if (estimate_parameter) then + dist(k) = dist(k)*0.25_r8 + else !not estimate_parameter + dist(k) = 2.0_r8 * PI + endif + + endif + +enddo ! loop over k = 1, num_close + +endif +end subroutine get_close_obs + + + +!=================================================================== +! End of model_mod +!=================================================================== +end module model_mod diff --git a/models/tiegcm/model_to_dart.f90 b/models/tiegcm/model_to_dart.f90 index f43e9180cc..98c675d9a1 100644 --- a/models/tiegcm/model_to_dart.f90 +++ b/models/tiegcm/model_to_dart.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ !---------------------------------------------------------------------- @@ -27,10 +25,9 @@ program model_to_dart implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'tiegcm/model_to_dart.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !----------------------------------------------------------------------- ! namelist parameters with default values. @@ -87,8 +84,3 @@ program model_to_dart end program model_to_dart -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/models/tiegcm/shell_scripts/advance_tiegcm.csh b/models/tiegcm/shell_scripts/advance_tiegcm.csh new file mode 100755 index 0000000000..da463aa2c1 --- /dev/null +++ b/models/tiegcm/shell_scripts/advance_tiegcm.csh @@ -0,0 +1,201 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +#------------------------------------------------------------------------------- +# This block of directives constitutes the preamble for the PBS queuing system +# +# the normal way to submit to the queue is: qsub run_filter.csh +# +#PBS -P n23 +#PBS -l walltime=0:05:00 +#PBS -l wd +#PBS -l ncpus=16 +#PBS -l mem=320000GB +#PBS -N tiegcm_advance +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe +#PBS -J 1-ENSEMBLESIZESTRING + +#=============================================================================== + +if ($?PBS_O_HOST) then + + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv INSTANCE $PBS_ARRAY_INDEX + set NODELIST = `cat "${PBS_NODEFILE}"` + set nproc = `cat ${PBS_NODEFILE} | wc -l` + +else + echo "This script must be run with a queueing system that supports job arrays." + exit 1 +endif + +#------------------------------------------------------------------------------- +# Just an echo of job attributes +#------------------------------------------------------------------------------- + +echo +echo "# Advancing TIE-GCM instance $INSTANCE started at "`date` +echo +echo "${JOBNAME} ($JOBID) working directory "`pwd` +echo "${JOBNAME} ($JOBID) running on ${NODELIST}" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +#------------------------------------------------------------------------------- +# STEP 1: Set the environment (modules, variables, etc.) for this experiment. +#------------------------------------------------------------------------------- + +# This string gets replaced by stage_experiment when it get copies into place. +# We need to be in the right directory before we can source DART_params.csh +cd CENTRALDIRSTRING + +if ( -e DART_params.csh ) then + source DART_params.csh +else + echo "ERROR: resource file 'DART_params.csh' not found." + echo " need one in "`pwd` + exit 1 +endif + +#------------------------------------------------------------------------------- +# STEP 2: Move to the directory specifi for this instance, prepare. +#------------------------------------------------------------------------------- + +set INSTANCE_DIRECTORY = `printf instance_%04d $INSTANCE` +cd ${INSTANCE_DIRECTORY} + +# Make sure we have a clean logfile for this entire advance +# and set the filename for the DART prior for this member. +set logfile = `printf log_advance.%04d.txt $INSTANCE` +set output_file = `printf filter_ics.%04d $INSTANCE` + +rm -f $logfile +rm -f input.nml +rm -f tiegcm.nml.updated +rm -f dart_ics + +# Ensure that the input.nml has the required value for +# dart_to_model_nml:advance_time_present for this context. + +sed -e "/advance_time_present /c\ advance_time_present = .TRUE." \ + ../input.nml >! input.nml || exit 2 + +set mpirun = `cat ../mpirun.command` +set RUN_CMD = "$mpirun -np $nproc" + +#------------------------------------------------------------------------------- +# STEP 3: Convert the DART output file to form needed by model. +# Overwrite the appropriate variables of a TIEGCM netCDF restart file. +# The DART output file (namelist_update) has the 'advance_to' time +# which must be communicated to the model ... through the tiegcm namelist +#------------------------------------------------------------------------------- + +ls -l dart_restart >>& $logfile || exit 3 +ls -l tiegcm_s.nc >>& $logfile || exit 3 +ls -l tiegcm_restart_p.nc >>& $logfile || exit 3 +ls -l tiegcm.nml >>& $logfile || exit 3 + +# dart_to_model also generates 'namelist_update' +../dart_to_model >>& $logfile || exit 3 + +# update tiegcm namelist variables by grabbing the values from namelist_update +# and then overwriting whatever is in the tiegcm.nml +# There is a danger that you match multiple things ... F107 and F107A, +# SOURCE_START and START, for example ... so try to grep whitespace too ... + +set start_year = `grep " START_YEAR " namelist_update` +set start_day = `grep " START_DAY " namelist_update` +set source_start = `grep " SOURCE_START " namelist_update` +set start = `grep " START " namelist_update` +set secstart = `grep " SECSTART " namelist_update` +set stop = `grep " STOP " namelist_update` +set secstop = `grep " SECSTOP " namelist_update` +set hist = `grep " HIST " namelist_update` +set sechist = `grep " SECHIST " namelist_update` +set f107 = `grep " F107 " namelist_update` + +# FIXME TOMOKO ... do we want F107 and F107A to be identical +# +# the way to think about the following sed syntax is this: +# / SearchStringWithWhiteSpaceToMakeUnique /c\ the_new_contents_of_the_line + +sed -e "/ START_YEAR /c\ ${start_year}" \ + -e "/ START_DAY /c\ ${start_day}" \ + -e "/ SOURCE_START /c\ ${source_start}" \ + -e "/ START /c\ ${start}" \ + -e "/ STOP /c\ ${stop}" \ + -e "/ HIST /c\ ${hist}" \ + -e "/ SECSTART /c\ ${secstart}" \ + -e "/ SECSTOP /c\ ${secstop}" \ + -e "/ SECHIST /c\ ${sechist}" \ + -e "/ F107 /c\ ${f107}" \ + tiegcm.nml >! tiegcm.nml.updated + +if ( -e tiegcm.nml.updated ) then + echo "tiegcm.nml updated with new start/stop time for ensemble member $INSTANCE" + mv -v tiegcm.nml tiegcm.nml.original + mv -v tiegcm.nml.updated tiegcm.nml +else + echo "ERROR tiegcm.nml did not update correctly for ensemble member $INSTANCE." + exit 3 +endif + +#------------------------------------------------------------------------------- +# STEP 4: Run the model +#------------------------------------------------------------------------------- + +echo "ensemble member $INSTANCE : before tiegcm" >> $logfile +ncdump -v mtime tiegcm_restart_p.nc >>& $logfile +echo "Starting tiegcm at "`date` >> $logfile + +${RUN_CMD} ../tiegcm tiegcm.nml >>& $logfile + +grep -q "NORMAL EXIT" $logfile +set tiegcm_status = $status + +if ($tiegcm_status != 0) then + echo "ERROR: tiegcm model advance failed." + echo "ERROR: check $INSTANCE_DIRECTORY/$logfile" + exit 4 +endif + +echo "ensemble member $INSTANCE : after tiegcm" >> $logfile +ncdump -v mtime tiegcm_restart_p.nc >>& $logfile + +# grab the bits needed for unique timestamp +set YEAR = $start_year[3] +set DOY = $stop[3] +set HOUR = $stop[5] +set TIMESTAMP = ${YEAR}.${DOY}.${HOUR} + +#------------------------------------------------------------------------------- +# STEP 5: Convert the model output to form needed by DART +# AT this point, the model has updated the information in tiegcm_restart_p.nc +# We need to get that information back into the DART state vector. +# +# The updated information needs to be moved into CENTRALDIR in +# preparation for the next cycle. +#------------------------------------------------------------------------------- + +echo "Starting model_to_dart at "`date` >> $logfile +../model_to_dart >>& $logfile + +if ( -e dart_ics ) then + ${COPY} dart_ics dart_priors.${TIMESTAMP} || exit 5 + ${MOVE} dart_ics ../$output_file || exit 5 + echo + echo "Finished advance_tiegcm.csh for member $INSTANCE at "`date` + +else + echo + echo "ERROR: model_to_dart failed for member $INSTANCE" + exit 5 +endif + +exit 0 diff --git a/models/tiegcm/shell_scripts/assimilate.csh b/models/tiegcm/shell_scripts/assimilate.csh new file mode 100755 index 0000000000..fc2684701f --- /dev/null +++ b/models/tiegcm/shell_scripts/assimilate.csh @@ -0,0 +1,254 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# script to perform a single assimilation. filter does not advance the model. +# The observation sequence file is chopped into the exact timeframe needed for +# the assimilation. +# +# This script is designed to be submitted as a batch job but may be run from +# the command line (as a single thread) to check for file motion, etc. +# If running interactively, please comment out the part that actually runs filter. +# +#------------------------------------------------------------------------------- +# +#PBS -P n23 +#PBS -l walltime=0:05:00 +#PBS -l wd +#PBS -l ncpus=16 +#PBS -l mem=320000GB +#PBS -N assim +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe + +#=============================================================================== + +if ($?PBS_O_HOST) then + + setenv ORIGINALDIR `pwd` + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv MYQUEUE $PBS_QUEUE + setenv MYHOST $HOSTNAME + setenv MPI_RUN_CMD mpirun + + # MP_DEBUG_NOTIMEOUT may alleviate MPI timeouts that may occur under + # certain task geometries. It is NOT a good idea to use it in general. + # setenv MP_DEBUG_NOTIMEOUT yes + +else + + #---------------------------------------------------------------------------- + # You can run this interactively to check syntax, file motion, etc. + #---------------------------------------------------------------------------- + + setenv ORIGINALDIR `pwd` + setenv JOBNAME tiegcm_filter + setenv JOBID $$ + setenv MYQUEUE Interactive + setenv MYHOST $HOST + setenv MPI_RUN_CMD '' + +endif + +#------------------------------------------------------------------------------- +# Just an echo of job attributes +#------------------------------------------------------------------------------- + +echo +echo "${JOBNAME} ($JOBID) submitted from $ORIGINALDIR" +echo "${JOBNAME} ($JOBID) submitted from $MYHOST" +echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE" +echo "${JOBNAME} ($JOBID) running on $MYHOST" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +#------------------------------------------------------------------------------- +# STEP 1: Set the environment (modules, variables, etc.) for this experiment. +#------------------------------------------------------------------------------- + +# This string gets replaced by stage_experiement when it get copies into place. +# We need to be in the right directory before we can source DART_params.csh +cd CENTRALDIRSTRING + +if ( -e DART_params.csh ) then + source DART_params.csh +else + echo "ERROR: resource file 'DART_params.csh' not found." + echo " need one in "`pwd` + exit 1 +endif + +# ------------------------------------------------------------------------------ +# STEP 2: Clear out previous results to avoid using stale information +# ------------------------------------------------------------------------------ + +${REMOVE} obs_seq.out obs_seq.final +${REMOVE} dart_log.out dart_log.nml + +# should have thought we could do these all on one line, but no ... +\unlink tiegcm_restart_p.nc +\unlink tiegcm_s.nc +\unlink tiegcm.nml + +${LINK} instance_0001/tiegcm_restart_p.nc tiegcm_restart_p.nc || exit 2 +${LINK} instance_0001/tiegcm_s.nc tiegcm_s.nc || exit 2 +${LINK} instance_0001/tiegcm.nml tiegcm.nml || exit 2 + +# ------------------------------------------------------------------------------ +# STEP 3: Get the right observation sequence file for this date/time +# ------------------------------------------------------------------------------ + +set mtime = `ncdump -v mtime tiegcm_restart_p.nc | tail -n 2 | head -n 1` + +set YEAR = 2018 +set DOY = `echo $mtime[1] | sed -e "s/,//"` +set HOUR = `echo $mtime[2] | sed -e "s/,//"` +set MINUTE = `echo $mtime[3] | sed -e "s/,//"` + +echo "MODEL TIME read as $YEAR $DOY $HOUR $MINUTE" + +set TIMESTAMP = `printf %03d%02d%02d $DOY $HOUR $MINUTE` + +# PRESUMING WE WANT +/- 30 MINS OF THE CURRENT MODEL TIME: +# Get the appropriate set of observations for this timeframe. + +set JAN1 = `printf %04d%02d%02d%02d%02d $YEAR 1 1 $HOUR $MINUTE` + +set TIME1 = `echo $JAN1 +${DOY}d-1d-1799s -g | ./advance_time` +set MTIME = `echo $JAN1 +${DOY}d-1d -g | ./advance_time` +set TIME2 = `echo $JAN1 +${DOY}d-1d+1800s -g | ./advance_time` +set ADVTIME = `echo $JAN1 +${DOY}d-1d+1h -g | ./advance_time` + +echo "start of assimilation window $TIME1" +echo "model time $MTIME" +echo "end of assimilation window $TIME2" +echo "advance_to_time $ADVTIME" + +set DAY1 = $TIME1[1] +set SEC1 = $TIME1[2] +set DAYN = $TIME2[1] +set SECN = $TIME2[2] + +${COPY} input.nml input.nml.original + +sed -e "/ first_obs_days /c\ first_obs_days = $DAY1" \ + -e "/ first_obs_seconds /c\ first_obs_seconds = $SEC1" \ + -e "/ last_obs_days /c\ last_obs_days = $DAYN" \ + -e "/ last_obs_seconds /c\ last_obs_seconds = $SECN" input.nml.original >! input.nml + +./obs_sequence_tool + +if (! -e obs_seq.out ) then + echo "ERROR: no observations for $YEAR $DOY $HOUR $MINUTE" + echo "ERROR: unable to create obs_seq.out" + exit 3 +endif + +${MOVE} input.nml.original input.nml + +# ------------------------------------------------------------------------------ +# STEP 4: [OPTIONAL] prepare for DART INFLATION +# This stages the files that contain the inflation values. +# The inflation values change through time and should be archived. +# +# This file is only relevant if 'inflation' is turned on - +# i.e. if inf_flavor(:) /= 0 AND inf_initial_from_restart = .TRUE. +# +# The strategy is to use the LATEST (last) inflation file, which is +# always available in the contents of the pointer file. +# ------------------------------------------------------------------------------ +# +# Only supporting prior state-space inflation for now. + +# If the inflation pointer file does not exist, we need to make one. +# This should only happen on the first assimilation cycle. + +if (! -e priorinf_pointer_file.txt ) then + if (! -e prior_inflate_ics ) then # run fill_inflation_restart.f90 + echo "1.01 0.6" | ./fill_inflation_restart || exit 4 + $MOVE inflate_ics prior_inflate_ics.$TIMESTAMP + echo "prior_inflate_ics.$TIMESTAMP" >! priorinf_pointer_file.txt + else + echo "ERROR: inflation staging failed." + exit 4 + endif +endif + +# Link the inflation file (output_priorinf_[mean,sd].DATE.nc) from +# the previous assimilation cycle to be used as input for the current +# assimilation. These are simply read, so linking is sufficient. + +set inflation_file = `head -n 1 priorinf_pointer_file.txt` + +${LINK} -f $inflation_file prior_inflate_ics + +# ------------------------------------------------------------------------------ +# STEP 5: assimilate the ensemble of new states. +# +# The stage_experiment script linked all the TIE-GCM files in the instance +# directories to the expected names required by filter. Should be good to go. +# ------------------------------------------------------------------------------ + +${MPI_RUN_CMD} ./filter || exit 3 + +if ( ! -e obs_seq.final ) then + echo "ERROR: filter did not finish successfully - no obs_seq.final" + exit 5 +endif + +# ------------------------------------------------------------------------------ +# STEP 6: Tag the output with the valid time of the model state. +# Update the inflation pointer file with the most recent file. +# ------------------------------------------------------------------------------ + +${MOVE} -v Prior_Diag.nc Prior_Diag.$TIMESTAMP.nc +${MOVE} -v Posterior_Diag.nc Posterior_Diag.$TIMESTAMP.nc +${MOVE} -v obs_seq.final obs_seq.final.$TIMESTAMP +${MOVE} -v namelist_update namelist_update.$TIMESTAMP + +if ( -e prior_inflate_restart ) then + ${MOVE} -v prior_inflate_restart prior_inflate_restart.$TIMESTAMP + echo "prior_inflate_restart.$TIMESTAMP" >! priorinf_pointer_file.txt +endif + +echo "$ADVTIME[2] $ADVTIME[1]" >! advance_to_time + +# Must copy each filter_restart.nnnn to the right place, update link +# so that 'dart_to_model' gets what it needs. +foreach RESTART ( filter_restart.???? ) + + # prepend the 'advance_to_time' record to the DART posterior. + # That way the advance_tiegcm.csh script (specifically dart_to_model) + # has the information about the next stop time for the forecast. + + cat advance_to_time $RESTART >! temp.file + ${MOVE} temp.file $RESTART + + # put the DART posterior in the right directory + set instance = $RESTART:e + set INSTANCE_DIRECTORY = `printf "instance_%04d" $instance` + cd $INSTANCE_DIRECTORY + ${MOVE} -v ../$RESTART $RESTART.$TIMESTAMP + \unlink dart_restart + ${LINK} $RESTART.$TIMESTAMP dart_restart + + cd .. +end + +# ------------------------------------------------------------------------------ +# STEP 7: Finish. +# ------------------------------------------------------------------------------ + +echo +echo "filter completed successfully at "`date` + +echo "${JOBNAME} ($JOBID) finished at "`date` +echo "These are the files in the run directory at completion:" +ls -lrt + +exit 0 + diff --git a/models/tiegcm/shell_scripts/run_perfect_model_obs.csh b/models/tiegcm/shell_scripts/run_perfect_model_obs.csh index 62c0d29d29..b43897fd84 100755 --- a/models/tiegcm/shell_scripts/run_perfect_model_obs.csh +++ b/models/tiegcm/shell_scripts/run_perfect_model_obs.csh @@ -1,11 +1,9 @@ #!/bin/csh # -# DART software - Copyright 2004 - 2013 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download # -# DART $Id$ -# # Top level script to generate observations and a TRUE state. # # This script is designed to be submitted as a batch job but may be run from @@ -16,8 +14,8 @@ # #BSUB -J tiegcm_perfect #BSUB -o tiegcm_perfect.%J.log -#BSUB -P P3507xxxx -#BSUB -q premium +#BSUB -P P8685xxxx +#BSUB -q small #BSUB -n 1 #BSUB -W 1:00 #BSUB -N -u ${USER}@ucar.edu @@ -230,8 +228,3 @@ ls -lrt exit 0 -# -# $URL$ -# $Revision$ -# $Date$ - diff --git a/models/tiegcm/shell_scripts/stage_experiment.csh b/models/tiegcm/shell_scripts/stage_experiment.csh new file mode 100755 index 0000000000..83fb992baa --- /dev/null +++ b/models/tiegcm/shell_scripts/stage_experiment.csh @@ -0,0 +1,312 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# The intent of this script is to create a single 'CENTRALDIR' directory that +# has sub-directories for each of the TIE-GCM model instances. All instances +# should be assumed to run simultaneously, so each directory should be entirely +# independent. If there are readonly resources, those can be linked instead +# of being copied. +# +# This script should only need to be run once per experiment. +# The intended workflow is: +# 0) stage the experiment (by running this script) +# 1) configure and run (interactively) the XXXXX script to submit a series of +# dependent jobs. +# Job 1) a job array that will dispatch N jobs where each job will advance +# a single ensemble member +# Job 2) If Job1 terminates normally, Job2 will run the assimilation. +# Job 3) same as Job 1 ... +# Job 4) same as Job 2 ... +# ... +# +##------------------------------------------------------------------------------ +## This block of directives constitutes the preamble for the PBS queuing system +## +## the normal way to submit to the queue is: qsub run_filter.csh +## +## an explanation of the most common directives follows: +## -N Job name +## -r n Declare job non-rerunable +## -e filename for standard error +## -o filename for standard out +## -q Queue name (small, medium, long, verylong) +## -l nodes=xx:ppn=2 requests BOTH processors on the node. On both bangkok +## and calgary, there is no way to 'share' the processors +## on the node with another job, so you might as well use +## them both. (ppn == Processors Per Node) +## +#PBS -P n23 +#PBS -l walltime=0:10:00 +#PBS -l wd +#PBS -l ncpus=1 +#PBS -l mem=32GB +#PBS -N stage_files +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe + +#=============================================================================== + +if ($?PBS_O_HOST) then + + setenv ORIGINALDIR `pwd` + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv MYQUEUE $PBS_QUEUE + setenv MYHOST $HOSTNAME + +else + + #------------------------------------------------------------------- + # You can run this interactively to check syntax, file motion, etc. + #------------------------------------------------------------------- + + setenv ORIGINALDIR `pwd` + setenv JOBNAME stage_files + setenv JOBID 1234 + setenv MYQUEUE Interactive + setenv MYHOST $HOST + +endif + +#---------------------------------------------------------------------- +# Just an echo of job attributes +#---------------------------------------------------------------------- + +echo +echo "${JOBNAME} ($JOBID) submitted from $ORIGINALDIR" +echo "${JOBNAME} ($JOBID) submitted from $MYHOST" +echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE" +echo "${JOBNAME} ($JOBID) running on $MYHOST" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +# CENTRALDIR Where the experiment will be run +# ENSEMBLEDIR The location of the initial ensemble of TIEGCM files +# TIEGCMDIR The location of the TIEGCM executable +# TGCMDATA The location of the TIEGCM support data +# DARTDIR The location of the DART tiegcm model directory +# OBSDIR The location of the input observation sequence files + +setenv CENTRALDIR /glade/scratch/thoar/tiegcm_experiments/job_${JOBID} +setenv ENSEMBLEDIR /glade/work/thoar/tiegcm_ensemble +setenv TIEGCMDIR /glade/work/thoar/git/DART_development/models/tiegcm/tiegcm +setenv TGCMDATA ${TIEGCMDIR}/tiegcm_res5.0_data +setenv DARTDIR /glade/work/thoar/git/DART_development/models/tiegcm +setenv OBSDIR /glade/work/thoar/tiegcm_ensemble + +mkdir -p ${CENTRALDIR} + +# Archive a copy of the script in the experiment directory +set myname = $0 +cp ${myname} ${CENTRALDIR}/${myname}.original + +cd ${CENTRALDIR} + +#---------------------------------------------------------------------- +# Make a 'resource file' that has all the variables for this experiment +#---------------------------------------------------------------------- + +cat << EndOfText >! DART_params.csh +#!/bin/csh +# Resource file for a DART experiment + +# Load required odules +# module load openmpi +# module load netcdf/4.7.3 +# module load hdf5 + +setenv REMOVE 'rm -rf' +setenv COPY 'cp -p' +setenv MOVE 'mv -f' +setenv LINK 'ln -s' + +setenv CENTRALDIR ${CENTRALDIR} +setenv TIEGCMDIR ${TIEGCMDIR} +setenv TGCMDATA ${TGCMDATA} +setenv DARTDIR ${DARTDIR} +setenv ENSEMBLEDIR ${ENSEMBLEDIR} + +echo "${JOBNAME} ($JOBID) CENTRALDIR == \${CENTRALDIR}" + +EndOfText + +# make the resource file executable +chmod 755 DART_params.csh + +# We need some of those resources, this makes them available. +source DART_params.csh + +#----------------------------------------------------------------------------- +# Populate the CENTRALDIR with everything that is common to all instances. +# Get the DART executables, scripts, and input files +# Get the tiegcm executable, control files, and data files. +# The individual ensemble member directories will be populated in a loop below. +#----------------------------------------------------------------------------- + +${COPY} ${DARTDIR}/work/filter . || exit 1 +${COPY} ${DARTDIR}/work/dart_to_model . || exit 1 +${COPY} ${DARTDIR}/work/model_to_dart . || exit 1 +${COPY} ${DARTDIR}/work/advance_time . || exit 1 +${COPY} ${DARTDIR}/work/fill_inflation_restart . || exit 1 +${COPY} ${DARTDIR}/work/obs_sequence_tool . || exit 1 +${COPY} ${DARTDIR}/work/input.nml . || exit 1 +${COPY} ${DARTDIR}/shell_scripts/submit_multiple_cycles.csh . || exit 1 + +# Determine the number of ensemble members from input.nml, +# it may exist in more than one place. +# Parse out the filter_nml string and see which +# one is immediately after it ... + +if ( ! -e input.nml ) then + echo "ERROR - input.nml does not exist in local directory." + echo "ERROR - input.nml needed to determine number of ensemble members." + exit 1 +endif + +set ENSEMBLESTRING = `grep -A 42 filter_nml input.nml | grep ens_size` +set NUM_ENS = `echo $ENSEMBLESTRING[3] | sed -e "s#,##"` + +# Need to convey the location of the experiment to the following scripts. +# Would not need to, but for a quirk of PBS. + +echo "s#CENTRALDIRSTRING#$CENTRALDIR#" + +sed -e "s#CENTRALDIRSTRING#$CENTRALDIR#" \ + ${DARTDIR}/shell_scripts/assimilate.csh >! assimilate.csh || exit 1 +sed -e "s#CENTRALDIRSTRING#$CENTRALDIR#" \ + -e "s#ENSEMBLESIZESTRING#$NUM_ENS#" \ + ${DARTDIR}/shell_scripts/advance_tiegcm.csh >! advance_tiegcm.csh || exit 1 + +# Make these scripte executable +chmod 755 assimilate.csh advance_tiegcm.csh + +${COPY} ${OBSDIR}/obs_seq.out obs_seq.input || exit 1 +${LINK} ${ENSEMBLEDIR}/tiegcm_restart_p.nc . || exit 1 +${LINK} ${ENSEMBLEDIR}/tiegcm_s.nc . || exit 1 +${COPY} ${ENSEMBLEDIR}/tiegcm.nml tiegcm.nml.original || exit 1 + +${COPY} ${TIEGCMDIR}/tiegcm.exec/tiegcm2.0 tiegcm || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/machines.ini . || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/mpirun.command . || exit 1 + +${COPY} ${TGCMDATA}/gswm* . || exit 1 +${COPY} ${TGCMDATA}/wei05sc.nc . || exit 1 + +#----------------------------------------------------------------------------- +# Make a unique directory for each model instance ... populate that +# directory with everything a TIE-GCM instance needs to run. If there +# are readonly resources, they can be 'linked' into the directory. + +@ instance = 1 +while ( $instance <= $NUM_ENS ) + + echo "Staging ensemble member $instance of $NUM_ENS at "`date` + + set member = `printf "%04d" $instance` + set rundir = instance_$member + mkdir $rundir + cd $rundir + + cp ../input.nml . + + set darticname = `printf "filter_ics.%04d" $instance` + set tiesecond = `printf "tiegcm_s.nc.%04d" $instance` + set tierestart = `printf "tiegcm_restart_p.nc.%04d" $instance` + + ${COPY} -v ${ENSEMBLEDIR}/$tiesecond tiegcm_s.nc || exit 2 + ${COPY} -v ${ENSEMBLEDIR}/$tierestart tiegcm_restart_p.nc || exit 2 + + # The gpi and imf files can get copied directly into each ensemble + # member rundir but retain the 'simple' name without the ensemble suffix. + # The ':r:t' retrieves just the simple name (no directory, no member). + set WHOLE_GPINAME = ${ENSEMBLEDIR}/gpi_*.nc.$member + set WHOLE_IMFNAME = ${ENSEMBLEDIR}/imf_*.nc.$member + set GPINAME = $WHOLE_GPINAME:r:t + set IMFNAME = $WHOLE_IMFNAME:r:t + + ${COPY} -v ${WHOLE_GPINAME} ${GPINAME} || exit 2 + ${COPY} -v ${WHOLE_IMFNAME} ${IMFNAME} || exit 2 + + # Ensure that the tiegcm.nml for all the ensemble members is identical + # in all the ways that matter. + + sed -e 's/;.*//' -e '/^$/ d' \ + -e "/ MXHIST_PRIM /c\ MXHIST_PRIM = 300" \ + -e "/ MXHIST_SECH /c\ MXHIST_SECH = 300" \ + -e "/ SOURCE /c\ SOURCE = 'tiegcm_restart_p.nc'" \ + -e "/ OUTPUT /c\ OUTPUT = 'tiegcm_restart_p.nc'" \ + -e "/ SECOUT /c\ SECOUT = 'tiegcm_s.nc'" \ + ${ENSEMBLEDIR}/tiegcm.nml >! tiegcm.nml || exit 2 + + # If an existing ensemble of filter_ics.#### exist, use it. + # If not, generate one. Be aware - even if they exist, they may + # not have the same variable set as your current input.nml + # If that is the case, you will have to generate your own set anyway. + # If you get an error from aread_state_restart(), this is likely the case. + + if ( -e ${ENSEMBLEDIR}/initial/$darticname.GENERATE ) then + ${REMOVE} $darticname + ${COPY} ${ENSEMBLEDIR}/initial/$darticname filter_ics || exit 2 + else + # We must convert a tiegcm_restart_p.nc file to a filter_ics file + # for each ensemble member. + + ../model_to_dart || exit 2 + + if (! -e dart_ics ) then + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + exit 2 + else + # Rename as expected input for filter ... + ${MOVE} dart_ics ../$darticname + endif + endif + + cd .. + + @ instance++ + +end + +echo "Finished staging the experiment at "`date` + +#------------------------------------------------------------------------------- +# Create some instructions for what do do next. + +cat << EndOfText >! README.txt + +# REQUIREMENTS: for input.nml +#----------------------------------------------------------------------------- +# obs_sequence_tool_nml: filename_seq = 'obs_seq.input' +# obs_sequence_tool_nml: filename_out = 'obs_seq.out' +#----------------------------------------------------------------------------- +# model_nml : tiegcm_restart_file_name = 'tiegcm_restart_p.nc' +# model_nml : tiegcm_secondary_file_name = 'tiegcm_s.nc' +# model_nml : tiegcm_namelist_file_name = 'tiegcm.nml' +# model_to_dart_nml : file_out = 'dart_ics' +#----------------------------------------------------------------------------- +# ensemble_manager_nml : single_restart_file_in = .false. +# filter_nml : async = 0 +# filter_nml : adv_ens_command = './no_advance_model.csh' +# filter_nml : start_from_restart = .TRUE. +# filter_nml : restart_in_file_name = 'filter_ics' +# filter_nml : restart_out_file_name = 'filter_restart' +#----------------------------------------------------------------------------- +# dart_to_model_nml : file_in = 'dart_restart' +# dart_to_model_nml : file_namelist_out = 'namelist_update' + +1) cd ${CENTRALDIR} +2) check namelists +3) ./submit_multiple_cycles 3 + +EndOfText + +cat README.txt + +exit 0 diff --git a/models/tiegcm/shell_scripts_gadi/advance_model.csh b/models/tiegcm/shell_scripts_gadi/advance_model.csh new file mode 100755 index 0000000000..eab560c26a --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/advance_model.csh @@ -0,0 +1,224 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ +# +# This script has 4 logical 'blocks': +# 1) creates a clean, temporary directory in which to run a model instance +# and copies the necessary files into the temporary directory +# 2) converts the DART output to input expected by the model +# 3) runs the model +# 4) converts the model output to input expected by DART +# +# The error code from the script reflects which block it failed. +# +# Arguments are the +# 1) process number of caller, +# 2) the number of state copies belonging to that process, and +# 3) the name of the filter_control_file for that process + +set process = $1 +set num_states = $2 +set control_file = $3 + +echo "Starting advance_model for process $process at "`date` + +#------------------------------------------------------------------------- +# Block 1: populate a run-time directory with the bits needed to run tiegcm. +#------------------------------------------------------------------------- + +# Get unique name for temporary working directory for this process's stuff +set temp_dir = `printf "advance_temp%04d" $process` + +# Create a clean temporary directory and go there +\rm -rf $temp_dir +mkdir -p $temp_dir +cd $temp_dir + +# The following is a list of the REQUIRED input.nml namelist settings +# +# &model_nml tiegcm_restart_file_name = 'tiegcm_restart_p.nc', +# tiegcm_secondary_file_name = 'tiegcm_s.nc', +# tiegcm_namelist_file_name = 'tiegcm.nml' +# &dart_to_model_nml file_in = 'dart_restart', +# file_namelist_out = 'namelist_update', +# &model_to_dart file_out = 'dart_ics' +# +# Ensure that the input.nml has the required value for +# dart_to_model_nml:advance_time_present for this context. + +sed -e "/advance_time_present /c\ advance_time_present = .TRUE." \ + ../input.nml >! input.nml || exit 1 + +# Check to see if you are running async==4 ... an mpirun.lsf situation +set MYSTRING = `grep -A 42 filter_nml input.nml | grep async` +set MYSTRING = `echo $MYSTRING | sed -e "s#[=,'\.]# #g"` +set ASYNC = $MYSTRING[2] + +if ($ASYNC == 4) then +# set RUN_CMD = mpirun.lsf +# set RUN_CMD = mpirun + set mpirun = `cat ../mpirun.command` + set nproc = $PBS_NCPUS + set RUN_CMD = $mpirun' -np '$nproc +else +# set RUN_CMD = '' +# set RUN_CMD = 'mpirun -np 1 --bind-to none' + set mpirun = `cat ../mpirun.command` + set RUN_CMD = $mpirun' -np 1 --bind-to none' +endif + +# Loop through each state +set state_copy = 1 +set ensemble_member_line = 1 +set input_file_line = 2 +set output_file_line = 3 + +while($state_copy <= $num_states) + + set ensemble_member = `head -n $ensemble_member_line ../$control_file | tail -n 1` + set input_file = `head -n $input_file_line ../$control_file | tail -n 1` + set output_file = `head -n $output_file_line ../$control_file | tail -n 1` + + # make sure we have a clean logfile for this entire advance + set logfile = `printf "log_advance.%04d.txt" $ensemble_member` + + echo "control_file is ../$control_file" >! $logfile + echo "working on ensemble_member $ensemble_member" >> $logfile + echo "input_file is $input_file" >> $logfile + echo "output_file is $output_file" >> $logfile + echo "Starting dart_to_model at "`date` >> $logfile + + #---------------------------------------------------------------------- + # Block 2: Convert the DART output file to form needed by model. + # Overwrite the appropriate variables of a TIEGCM netCDF restart file. + # The DART output file (namelist_update) has the 'advance_to' time + # which must be communicated to the model ... through the tiegcm namelist + #---------------------------------------------------------------------- + + set tiesecond = `printf "tiegcm_s.nc.%04d" $ensemble_member` + set tierestart = `printf "tiegcm_restart_p.nc.%04d" $ensemble_member` + set tieinp = `printf "tiegcm.nml.%04d" $ensemble_member` + + cp -pv ../$input_file dart_restart >>& $logfile || exit 2 + cp -pv ../$tiesecond tiegcm_s.nc >>& $logfile || exit 2 + cp -pv ../$tierestart tiegcm_restart_p.nc >>& $logfile || exit 2 + cp -pv ../$tieinp tiegcm.nml >>& $logfile || exit 2 + + # Copy across data for Weimar model required by TIE-GCM 2.0 + cp -p ../wei05sc.nc wei05sc.nc >>& $logfile || exit 2 + + ../dart_to_model >>& $logfile || exit 2 # dart_to_model generates namelist_update + + # update tiegcm namelist variables by grabbing the values from namelist_update + # and then overwriting whatever is in the tiegcm.nml + # There is a danger that you match multiple things ... F107 and F107A, + # SOURCE_START and START, for example ... so try to grep whitespace too ... + + set start_year = `grep " START_YEAR " namelist_update` + set start_day = `grep " START_DAY " namelist_update` + set source_start = `grep " SOURCE_START " namelist_update` + set start = `grep " START " namelist_update` + set secstart = `grep " SECSTART " namelist_update` + set stop = `grep " STOP " namelist_update` + set secstop = `grep " SECSTOP " namelist_update` + set hist = `grep " HIST " namelist_update` + set sechist = `grep " SECHIST " namelist_update` + set f107 = `grep " F107 " namelist_update` + + # FIXME TOMOKO ... do we want F107 and F107A to be identical + # + # the way to think about the following sed syntax is this: + # / SearchStringWithWhiteSpaceToMakeUnique /c\ the_new_contents_of_the_line + + sed -e "/ START_YEAR /c\ ${start_year}" \ + -e "/ START_DAY /c\ ${start_day}" \ + -e "/ SOURCE_START /c\ ${source_start}" \ + -e "/ START /c\ ${start}" \ + -e "/ STOP /c\ ${stop}" \ + -e "/ HIST /c\ ${hist}" \ + -e "/ SECSTART /c\ ${secstart}" \ + -e "/ SECSTOP /c\ ${secstop}" \ + -e "/ SECHIST /c\ ${sechist}" \ + -e "/ F107 /c\ ${f107}" \ + tiegcm.nml >! tiegcm.nml.updated + + if ( -e tiegcm.nml.updated ) then + echo "tiegcm.nml updated with new start/stop time for ensemble member $ensemble_member" + mv -v tiegcm.nml tiegcm.nml.original + mv -v tiegcm.nml.updated tiegcm.nml + else + echo "ERROR tiegcm.nml did not update correctly for ensemble member $ensemble_member." + exit 2 + endif + + #---------------------------------------------------------------------- + # Block 3: Run the model + #---------------------------------------------------------------------- + + echo "ensemble member $ensemble_member : before tiegcm" >> $logfile + ncdump -v mtime tiegcm_restart_p.nc >>& $logfile + echo "Starting tiegcm at "`date` >> $logfile + + ${RUN_CMD} ../tiegcm tiegcm.nml >>& $logfile + + #$mpirun -np $nproc ../tiegcm tiegcm.nml >>& $logfile + + grep -q "NORMAL EXIT" $logfile + set tiegcm_status = $status + + if ($tiegcm_status != 0) then + echo "ERROR: tiegcm model advance failed." + echo "ERROR: check $temp_dir/$logfile" + exit 3 + endif + + echo "ensemble member $ensemble_member : after tiegcm" >> $logfile + ncdump -v mtime tiegcm_restart_p.nc >>& $logfile + + #---------------------------------------------------------------------- + # Block 4: Convert the model output to form needed by DART + # AT this point, the model has updated the information in tiegcm_restart_p.nc + # We need to get that information back into the DART state vector. + # + # The updated information needs to be moved into CENTRALDIR in + # preparation for the next cycle. + #---------------------------------------------------------------------- + + echo "Starting model_to_dart at "`date` >> $logfile + ../model_to_dart >>& $logfile || exit 4 + + mv -v dart_ics ../$output_file || exit 4 + mv -v tiegcm_s.nc ../$tiesecond || exit 4 + mv -v tiegcm_restart_p.nc ../$tierestart || exit 4 + mv -v tiegcm.nml ../$tieinp || exit 4 + + @ state_copy++ + @ ensemble_member_line = $ensemble_member_line + 3 + @ input_file_line = $input_file_line + 3 + @ output_file_line = $output_file_line + 3 + echo "Finished model_to_dart at "`date` >> $logfile +end + +# Change back to original directory +cd .. + +# After you are assured this script works as expected, you can actually +# remove the temporary directory. For now ... leave this commented OUT. +#\rm -rf $temp_dir + +# Remove the filter_control file to signal completion +\rm -fv $control_file + +echo "Finished advance_model for process $process at "`date` + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/models/tiegcm/shell_scripts_gadi/advance_tiegcm.csh b/models/tiegcm/shell_scripts_gadi/advance_tiegcm.csh new file mode 100755 index 0000000000..78ee316a43 --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/advance_tiegcm.csh @@ -0,0 +1,194 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +#------------------------------------------------------------------------------- +# This block of directives constitutes the preamble for the PBS queuing system +# +# the normal way to submit to the queue is: qsub run_filter.csh +# +#PBS -P n23 +#PBS -l walltime=0:05:00 +#PBS -l wd +#PBS -l ncpus=16 +#PBS -l mem=320000GB +#PBS -N tiegcm_advance +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe +#PBS -J 1-ENSEMBLESIZESTRING + +#=============================================================================== + +if ($?PBS_O_HOST) then + + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv ARRAY_INDEX $PBS_ARRAY_INDEX + set NODELIST = `cat "${PBS_NODEFILE}"` + set nproc = $PBS_NCPUS + +else + echo "This script must be run with a queueing system that supports job arrays." + exit 1 +endif + +#------------------------------------------------------------------------------- +# Just an echo of job attributes +#------------------------------------------------------------------------------- + +echo +echo "# Advancing TIE-GCM instance $instance started at "`date` +echo +echo "${JOBNAME} ($JOBID) working directory "`pwd` +echo "${JOBNAME} ($JOBID) running on ${NODELIST}" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +#------------------------------------------------------------------------------- +# STEP 1: Set the environment (modules, variables, etc.) for this experiment. +#------------------------------------------------------------------------------- + +# This string gets replaced by stage_experiment when it get copies into place. +# We need to be in the right directory before we can source DART_params.csh +cd CENTRALDIRSTRING + +if ( -e DART_params.csh ) then + source DART_params.csh +else + echo "ERROR: resource file 'DART_params.csh' not found." + echo " need one in "`pwd` + exit 1 +endif + +#------------------------------------------------------------------------------- +# STEP 2: Move to the directory specifi for this instance, prepare. +#------------------------------------------------------------------------------- + +set instance = $ARRAY_INDEX +set INSTANCE_DIRECTORY = `printf "instance_%04d" $instance` +cd ${INSTANCE_DIRECTORY} + +rm -f log_$instance.txt +rm -f input.nml +rm -f tiegcm.nml.updated + +# Ensure that the input.nml has the required value for +# dart_to_model_nml:advance_time_present for this context. + +sed -e "/advance_time_present /c\ advance_time_present = .TRUE." \ + ../input.nml >! input.nml || exit 1 + +set mpirun = `cat ../mpirun.command` +set RUN_CMD = "$mpirun -np $nproc" + +#------------------------------------------------------------------------------- +# STEP 3: Convert the DART output file to form needed by model. +# Overwrite the appropriate variables of a TIEGCM netCDF restart file. +# The DART output file (namelist_update) has the 'advance_to' time +# which must be communicated to the model ... through the tiegcm namelist +#------------------------------------------------------------------------------- + +# make sure we have a clean logfile for this entire advance +set logfile = `printf "log_advance.%04d.txt" $instance` + +ls -l dart_restart >>& $logfile || exit 2 +ls -l tiegcm_s.nc >>& $logfile || exit 2 +ls -l tiegcm_restart_p.nc >>& $logfile || exit 2 +ls -l tiegcm.nml >>& $logfile || exit 2 + +# dart_to_model also generates 'namelist_update' +../dart_to_model >>& $logfile || exit 2 + +# update tiegcm namelist variables by grabbing the values from namelist_update +# and then overwriting whatever is in the tiegcm.nml +# There is a danger that you match multiple things ... F107 and F107A, +# SOURCE_START and START, for example ... so try to grep whitespace too ... + +set start_year = `grep " START_YEAR " namelist_update` +set start_day = `grep " START_DAY " namelist_update` +set source_start = `grep " SOURCE_START " namelist_update` +set start = `grep " START " namelist_update` +set secstart = `grep " SECSTART " namelist_update` +set stop = `grep " STOP " namelist_update` +set secstop = `grep " SECSTOP " namelist_update` +set hist = `grep " HIST " namelist_update` +set sechist = `grep " SECHIST " namelist_update` +set f107 = `grep " F107 " namelist_update` + +# FIXME TOMOKO ... do we want F107 and F107A to be identical +# +# the way to think about the following sed syntax is this: +# / SearchStringWithWhiteSpaceToMakeUnique /c\ the_new_contents_of_the_line + +sed -e "/ START_YEAR /c\ ${start_year}" \ + -e "/ START_DAY /c\ ${start_day}" \ + -e "/ SOURCE_START /c\ ${source_start}" \ + -e "/ START /c\ ${start}" \ + -e "/ STOP /c\ ${stop}" \ + -e "/ HIST /c\ ${hist}" \ + -e "/ SECSTART /c\ ${secstart}" \ + -e "/ SECSTOP /c\ ${secstop}" \ + -e "/ SECHIST /c\ ${sechist}" \ + -e "/ F107 /c\ ${f107}" \ + tiegcm.nml >! tiegcm.nml.updated + +if ( -e tiegcm.nml.updated ) then + echo "tiegcm.nml updated with new start/stop time for ensemble member $instance" + mv -v tiegcm.nml tiegcm.nml.original + mv -v tiegcm.nml.updated tiegcm.nml +else + echo "ERROR tiegcm.nml did not update correctly for ensemble member $instance." + exit 2 +endif + +#------------------------------------------------------------------------------- +# STEP 4: Run the model +#------------------------------------------------------------------------------- + +echo "ensemble member $instance : before tiegcm" >> $logfile +ncdump -v mtime tiegcm_restart_p.nc >>& $logfile +echo "Starting tiegcm at "`date` >> $logfile + +${RUN_CMD} ../tiegcm tiegcm.nml >>& $logfile + +grep -q "NORMAL EXIT" $logfile +set tiegcm_status = $status + +if ($tiegcm_status != 0) then + echo "ERROR: tiegcm model advance failed." + echo "ERROR: check $temp_dir/$logfile" + exit 3 +endif + +echo "ensemble member $instance : after tiegcm" >> $logfile +ncdump -v mtime tiegcm_restart_p.nc >>& $logfile + +# grab the bits needed for unique timestamp +set YEAR = $start_year[3] +set DOY = $stop[3] +set HOUR = $stop[5] +set TIMESTAMP = ${YEAR}.${DOY}.${HOUR} + +#------------------------------------------------------------------------------- +# STEP 5: Convert the model output to form needed by DART +# AT this point, the model has updated the information in tiegcm_restart_p.nc +# We need to get that information back into the DART state vector. +# +# The updated information needs to be moved into CENTRALDIR in +# preparation for the next cycle. +#------------------------------------------------------------------------------- + +echo "Starting model_to_dart at "`date` >> $logfile +../model_to_dart >>& $logfile || exit 4 + +mv -v dart_ics ../$output_file || exit 4 +mv -v tiegcm.nml ../$tieinp || exit 4 + +cp dart_ics dart_ics.${TIMESTAMP} + +echo "Finished advance_model for process $process at "`date` + +exit 0 diff --git a/models/tiegcm/shell_scripts_gadi/assimilate.csh b/models/tiegcm/shell_scripts_gadi/assimilate.csh new file mode 100755 index 0000000000..92336dca7f --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/assimilate.csh @@ -0,0 +1,211 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# script to perform a single assimilation. filter does not advance the model. +# The observation sequence file is chopped into the exact timeframe needed for +# the assimilation. +# +# This script is designed to be submitted as a batch job but may be run from +# the command line (as a single thread) to check for file motion, etc. +# If running interactively, please comment out the part that actually runs filter. +# +#------------------------------------------------------------------------------- +# +#PBS -P n23 +#PBS -l walltime=0:05:00 +#PBS -l wd +#PBS -l ncpus=16 +#PBS -l mem=320000GB +#PBS -N assim +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe + +#=============================================================================== + +if ($?PBS_O_HOST) then + + setenv ORIGINALDIR `pwd` + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv MYQUEUE $PBS_QUEUE + setenv MYHOST $HOSTNAME + setenv MPI_RUN_CMD mpirun + + # MP_DEBUG_NOTIMEOUT may alleviate MPI timeouts that may occur under + # certain task geometries. It is NOT a good idea to use it in general. + # setenv MP_DEBUG_NOTIMEOUT yes + +else + + #---------------------------------------------------------------------------- + # You can run this interactively to check syntax, file motion, etc. + #---------------------------------------------------------------------------- + + setenv ORIGINALDIR `pwd` + setenv JOBNAME tiegcm_filter + setenv JOBID $$ + setenv MYQUEUE Interactive + setenv MYHOST $HOST + setenv MPI_RUN_CMD '' + +endif + +#------------------------------------------------------------------------------- +# Just an echo of job attributes +#------------------------------------------------------------------------------- + +echo +echo "${JOBNAME} ($JOBID) submitted from $ORIGINALDIR" +echo "${JOBNAME} ($JOBID) submitted from $MYHOST" +echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE" +echo "${JOBNAME} ($JOBID) running on $MYHOST" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +#------------------------------------------------------------------------------- +# STEP 1: Set the environment (modules, variables, etc.) for this experiment. +#------------------------------------------------------------------------------- + +# This string gets replaced by stage_experiement when it get copies into place. +# We need to be in the right directory before we can source DART_params.csh +cd CENTRALDIRSTRING + +if ( -e DART_params.csh ) then + source DART_params.csh +else + echo "ERROR: resource file 'DART_params.csh' not found." + echo " need one in "`pwd` + exit 1 +endif + +# ------------------------------------------------------------------------------ +# STEP 2: Clear out previous results to avoid using stale information +# ------------------------------------------------------------------------------ + +${REMOVE} obs_seq.out obs_seq.final +${REMOVE} dart_log.out dart_log.nml + +\unlink tiegcm_restart_p.nc tiegcm_s.nc tiegcm.nml + +${LINK} tiegcm_restart_p.nc.0001 tiegcm_restart_p.nc || exit 3 +${LINK} tiegcm_s.nc.0001 tiegcm_s.nc || exit 3 +${LINK} tiegcm.nml.0001 tiegcm.nml || exit 3 + +# ------------------------------------------------------------------------------ +# STEP 3: Get the right observation sequence file for this date/time +# ------------------------------------------------------------------------------ + +set mtime = `ncdump -v mtime tiegcm_restart_p.nc | tail -n 2 | head -n 1` + +set YEAR = 2018 +set DOY = `echo $mtime[1] | sed -e "s/,//"` +set HOUR = `echo $mtime[2] | sed -e "s/,//"` +set MINUTE = `echo $mtime[3] | sed -e "s/,//"` + +echo "MODEL TIME read as $YEAR $DOY $HOUR $MINUTE" + +set TIMESTAMP = `printf %02d%02d%02d $HOUR $MINUTE $SECOND` + +# Get the appropriate set of observations for this timeframe. + +if ( -e $OBSDIR/obs_seq.$TIMESTAMP.out ) then + ${LINK} $OBSDIR/obs_seq.$TIMESTAMP.out obs_seq.out || exit 3 +else + # could run obs_sequence_tool to cut out just the obs of interest + echo "ERROR: no observations for $YEAR $DOY $HOUR $MINUTE" + echo "ERROR: expecting a file: $OBSDIR/obs_seq.$TIMESTAMP.out" + exit 3 +endif + +# ------------------------------------------------------------------------------ +# STEP 4: [OPTIONAL] prepare for DART INFLATION +# This stages the files that contain the inflation values. +# The inflation values change through time and should be archived. +# +# This file is only relevant if 'inflation' is turned on - +# i.e. if inf_flavor(:) /= 0 AND inf_initial_from_restart = .TRUE. +# +# The strategy is to use the LATEST (last) inflation file, which is +# always available in the contents of the pointer file. +# ------------------------------------------------------------------------------ +# +# Only supporting prior state-space inflation for now. + +# If the inflation pointer file does not exist, we need to make one. +# This should only happen on the first assimilation cycle. + +if (! -e priorinf_pointer_file.txt ) then + if ( -e prior_inflate_ics ) then # run fill_inflation_restart.f90 + # ./fill_inflation_restart + $MOVE prior_inflate_ics prior_inflate_ics.$TIMESTAMP + echo "prior_inflate_ics.$TIMESTAMP" >! priorinf_pointer_file.txt + else + echo "ERROR: inflation staging failed." + exit 4 + endif +endif + +# Link the inflation file (output_priorinf_[mean,sd].DATE.nc) from +# the previous assimilation cycle to be used as input for the current +# assimilation. These are simply read, so linking is sufficient. + +set inflation_file = `head -n 1 priorinf_pointer_file.txt` + +${LINK} -f $inflation_file prior_inflate_ics + +# ------------------------------------------------------------------------------ +# STEP 5: assimilate the ensemble of new states. +# +# The stage_experiment script linked all the TIE-GCM files in the instance +# directories to the expected names required by filter. Should be good to go. +# ------------------------------------------------------------------------------ + +${MPI_RUN_CMD} ./filter || exit 3 + +if ( ! -e obs_seq.final ) then + echo "ERROR: filter did not finish successfully - no obs_seq.final" + exit 5 +endif + +# ------------------------------------------------------------------------------ +# STEP 6: Tag the output with the valid time of the model state. +# Update the inflation pointer file with the most recent file. +# ------------------------------------------------------------------------------ + +${MOVE} -v obs_seq.final obs_seq.final.$TIMESTAMP +${MOVE} -v namelist_update namelist_update.$TIMESTAMP + +if ( -e prior_inflate_restart ) then + ${MOVE} -v prior_inflate_restart prior_inflate_restart.$TIMESTAMP + echo "prior_inflate_restart.$TIMESTAMP" >! priorinf_pointer_file.txt +endif + +# Must copy each filter_restart.nnnn to the right place, update link +# so that 'dart_to_model' gets what it needs. +foreach RESTART ( filter_restart.???? ) + set instance = $RESTART:e + set INSTANCE_DIRECTORY = `printf "instance_%04d" $instance` + cd $INSTANCE_DIRECTORY + ${MOVE} -v ../$RESTART $RESTART.$TIMESTAMP + \unlink dart_restart + ${LINK} $RESTART.$TIMESTAMP dart_restart + cd .. +end + +# ------------------------------------------------------------------------------ +# STEP 7: Finish. +# ------------------------------------------------------------------------------ + +echo +echo "filter completed successfully at "`date` + +echo "${JOBNAME} ($JOBID) finished at "`date` +echo "These are the files in the run directory at completion:" +ls -lrt + +exit 0 + diff --git a/models/tiegcm/shell_scripts_gadi/run_filter.csh b/models/tiegcm/shell_scripts_gadi/run_filter.csh new file mode 100755 index 0000000000..a5f5631ca1 --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/run_filter.csh @@ -0,0 +1,322 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ +# +# Top level script to perform an assimilation. +# +# This script is designed to be submitted as a batch job but may be run from +# the command line (as a single thread) to check for file motion, etc. +# If running interactively, please comment out the part that actually runs filter. +# +# PLEASE READ THE FOLLOWING: +# Setting the number of tasks and choosing the right ptile requires work. +# The number of tasks (-n) can be be as big as the ensemble size for +# a single-threaded tiegcm (i.e. async == 2) so that all ensemble members can +# run simultaneously. The setting of ptile specifies the number of tasks on each +# node, which usually depends on the model resolution and subsequent memory use +# of each ensemble member. Think of ptile as the number of ensemble members you +# can run on one node and not run out of the shared memory on that node. +# If you specify more tasks than ensemble members, there are tasks that have +# nothing to do during the model advance. If the model advance step takes longer +# than the MPI timeout on your machine, you may need to disable the MPI timeout. +#----------------------------------------------------------------------------- +# +#PBS -P n23 +#PBS -l walltime=0:05:00 +#PBS -l wd +#PBS -l ncpus=4 +#PBS -l mem=32GB +#PBS -N run_tiegcm_assim_gadi +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe + +#---------------------------------------------------------------------- +# Turns out the scripts are a lot more flexible if you don't rely on +# the queuing-system-specific variables -- so I am converting them to +# 'generic' names and using the generics throughout the remainder. +#---------------------------------------------------------------------- + +# Load required modules +module load openmpi +module load netcdf/4.7.3 +module load hdf5 + +if ($?PBS_O_HOST) then + + setenv ORIGINALDIR `pwd` + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv MYQUEUE $PBS_QUEUE + setenv MYHOST $HOSTNAME + setenv MPI_RUN_CMD mpirun + + # MP_DEBUG_NOTIMEOUT may alleviate MPI timeouts that may occur under + # certain task geometries. It is NOT a good idea to use it in general. + # setenv MP_DEBUG_NOTIMEOUT yes + +else + + #------------------------------------------------------------------- + # You can run this interactively to check syntax, file motion, etc. + #------------------------------------------------------------------- + + setenv ORIGINALDIR `pwd` + setenv JOBNAME tiegcm_filter + setenv JOBID $$ + setenv MYQUEUE Interactive + setenv MYHOST $HOST + setenv MPI_RUN_CMD '' + +endif + +#---------------------------------------------------------------------- +# Just an echo of job attributes +#---------------------------------------------------------------------- + +echo +echo "${JOBNAME} ($JOBID) submitted from $ORIGINALDIR" +echo "${JOBNAME} ($JOBID) submitted from $MYHOST" +echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE" +echo "${JOBNAME} ($JOBID) running on $MYHOST" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +#---------------------------------------------------------------------- +# Make a unique, (empty, clean) temporary directory. +#---------------------------------------------------------------------- + +#setenv CENTRALDIR /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/${JOBNAME}/job_${JOBID} +cd ../../.. +setenv CENTRALDIR `pwd`/${JOBNAME}/job_${JOBID} + +mkdir -p ${CENTRALDIR} +cd ${CENTRALDIR} + +set myname = $0 # this is the name of this script + +# some systems don't like the -v option to any of the following + +set OSTYPE = `uname -s` +switch ( ${OSTYPE} ) + case IRIX64: + setenv REMOVE 'rm -rf' + setenv COPY 'cp -p' + setenv MOVE 'mv -f' + setenv LINK 'ln -s' + breaksw + case AIX: + setenv REMOVE 'rm -rf' + setenv COPY 'cp -p' + setenv MOVE 'mv -f' + setenv LINK 'ln -s' + breaksw + default: + setenv REMOVE 'rm -rvf' + setenv COPY 'cp -v' + setenv MOVE 'mv -fv' + setenv LINK 'ln -s' + breaksw +endsw + +echo "${JOBNAME} ($JOBID) CENTRALDIR == $CENTRALDIR" + +#----------------------------------------------------------------------------- +# Set variables containing various directory names where we will GET things +# DARTDIR The location of the DART tiegcm model directory +# TIEGCMDIR The location of the TIEGCM executable +# ENSEMBLEDIR The location of the initial ensemble of TIEGCM files +# EXPERIMENT The (safe) location for the results of this run. +#----------------------------------------------------------------------------- + +set DARTDIR = /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/models/tiegcm +set TIEGCMDIR = /scratch/n23/gwb112/swm_project/TIEGCM +set TIEGCMDATA = ${TIEGCMDIR}/tiegcm_res5.0_data +set EXPERIMENT = /scratch/n23/gwb112/swm_project/gold_test +set ENSEMBLEDIR = /scratch/n23/gwb112/swm_project/gold_test/initial + +# Need to set TGCMDATA environment variable +setenv TGCMDATA $TIEGCMDATA + +#----------------------------------------------------------------------------- +# Get the DART executables, scripts, and input files +# Get the tiegcm executable, control files, and data files. +# The tiegcm initial conditions are in the next block. +#----------------------------------------------------------------------------- + +${COPY} ${DARTDIR}/work/filter . || exit 1 +${COPY} ${DARTDIR}/work/dart_to_model . || exit 1 +${COPY} ${DARTDIR}/work/model_to_dart . || exit 1 +${COPY} ${DARTDIR}/work/input.nml input.nml.original || exit 1 +${COPY} ${DARTDIR}/shell_scripts_gadi/advance_model.csh . || exit 1 + +#${COPY} ${EXPERIMENT}/observation/obs_seq.out . || exit 1 +${COPY} ${EXPERIMENT}/initial/obs_seq.out . || exit 1 +${COPY} ${EXPERIMENT}/initial/tiegcm_restart_p.nc . || exit 1 +${COPY} ${EXPERIMENT}/initial/tiegcm_s.nc . || exit 1 +${COPY} ${EXPERIMENT}/initial/tiegcm.nml tiegcm.nml.original || exit 1 +${COPY} ${EXPERIMENT}/initial/gpi*.nc.* . || exit 1 +${COPY} ${EXPERIMENT}/initial/imf*.nc.* . || exit 1 + +${COPY} ${TIEGCMDIR}/tiegcm.exec/tiegcm2.0 tiegcm || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/machines.ini . || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/mpirun.command . || exit 1 + +${COPY} ${TIEGCMDATA}/gswm* . || exit 1 +${COPY} ${TIEGCMDATA}/wei05sc.nc . || exit 1 + +#----------------------------------------------------------------------------- +# Put all of the DART initial conditions files and all of the TIEGCM files +# in the CENTRALDIR - preserving the ensemble member ID for each filename. +# The advance_model.csh script will copy the appropriate files for each +# ensemble member into the model advance directory. +# These files may be linked to CENTRALDIR since they get copied to the +# model advance directory. +# +# REQUIREMENTS: for input.nml +# model_nml : tiegcm_restart_file_name = 'tiegcm_restart_p.nc' +# model_nml : tiegcm_secondary_file_name = 'tiegcm_s.nc' +# model_nml : tiegcm_namelist_file_name = 'tiegcm.nml' +# model_to_dart_nml : file_out = 'dart_ics' +#----------------------------------------------------------------------------- +# ensemble_manager_nml : single_restart_file_in = .false. +# filter_nml : async = 2 +# filter_nml : adv_ens_command = './advance_model.csh' +# filter_nml : start_from_restart = .TRUE. +# filter_nml : restart_in_file_name = 'filter_ics' +# filter_nml : restart_out_file_name = 'filter_restart' +#----------------------------------------------------------------------------- +# dart_to_model_nml : file_in = 'dart_restart' +# dart_to_model_nml : file_namelist_out = 'namelist_update' + +sed -e "/ tiegcm_restart_file_name /c\ tiegcm_restart_file_name = 'tiegcm_restart_p.nc'" \ + -e "/ tiegcm_secondary_file_name /c\ tiegcm_secondary_file_name = 'tiegcm_s.nc'" \ + -e "/ tiegcm_namelist_file_name /c\ tiegcm_namelist_file_name = 'tiegcm.nml'" \ + -e "/ file_out /c\ file_out = 'dart_ics'" \ + -e "/ single_restart_file_in /c\ single_restart_file_in = .FALSE." \ + -e "/ async /c\ async = 2" \ + -e "/ adv_ens_command /c\ adv_ens_command = './advance_model.csh'" \ + -e "/ start_from_restart /c\ start_from_restart = .TRUE." \ + -e "/ restart_in_file_name /c\ restart_in_file_name = 'filter_ics'" \ + -e "/ restart_out_file_name /c\ restart_out_file_name = 'filter_restart'" \ + -e "/ file_in /c\ file_in = 'dart_restart'" \ + -e "/ file_namelist_out /c\ file_namelist_out = 'namelist_update'" \ + input.nml.original >! input.nml || exit 2 + +set ENSEMBLESTRING = `grep -A 42 filter_nml input.nml | grep ens_size` +set NUM_ENS = `echo $ENSEMBLESTRING[3] | sed -e "s#,##"` + +@ instance = 1 +while ( $instance <= $NUM_ENS ) + + set darticname = `printf "filter_ics.%04d" $instance` + set tiesecond = `printf "tiegcm_s.nc.%04d" $instance` + set tierestart = `printf "tiegcm_restart_p.nc.%04d" $instance` + set tieinp = `printf "tiegcm.nml.%04d" $instance` + + ${COPY} ${ENSEMBLEDIR}/$tiesecond . || exit 2 + ${COPY} ${ENSEMBLEDIR}/$tierestart . || exit 2 + ${COPY} ${ENSEMBLEDIR}/$tieinp tiegcm.nml.original || exit 2 + + # Ensure that the tiegcm.nml for all the ensemble members is identical + # in all the ways that matter. This will result in a miniumum of changes + # in the advance_model.csh script. This script REQUIRES that there is a + # SINGLE tiegcm_restart_p.nc. Just keep appending all the timesteps to + # the same file. If you need to subset the large file, use the NCO + # operators. for example ncks -d time,20,30 tiegcm_restart_p.nc bob.nc + # If you need more than 300 timesteps in the file, increase it here. + + sed -e 's/;.*//' -e '/^$/ d' \ + -e "/ MXHIST_PRIM /c\ MXHIST_PRIM = 300" \ + -e "/ MXHIST_SECH /c\ MXHIST_SECH = 300" \ + -e "/ SOURCE /c\ SOURCE = 'tiegcm_restart_p.nc'" \ + -e "/ OUTPUT /c\ OUTPUT = 'tiegcm_restart_p.nc'" \ + -e "/ SECOUT /c\ SECOUT = 'tiegcm_s.nc'" \ + tiegcm.nml.original >! $tieinp || exit 2 + + # If an existing ensemble of filter_ics.#### exist, use it. + # If not, generate one. Be aware - even if they exist, they may + # not have the same variable set as your current input.nml + # If that is the case, you will have to generate your own set anyway. + # If you get an error from aread_state_restart(), this is likely the case. + + if ( -e ${ENSEMBLEDIR}/initial/$darticname.GENERATE ) then + ${REMOVE} $darticname + ${LINK} ${ENSEMBLEDIR}/initial/$darticname . || exit 2 + else + # We must convert a tiegcm_restart_p.nc file to a dart_ics file + # for each ensemble member. So - momentarily, we must + # create links to the static filenames expected by model_to_dart + + ${REMOVE} tiegcm_restart_p.nc tiegcm_s.nc tiegcm.nml + + ${LINK} $tierestart tiegcm_restart_p.nc || exit 2 + ${LINK} $tiesecond tiegcm_s.nc || exit 2 + ${LINK} $tieinp tiegcm.nml || exit 2 + + ./model_to_dart || exit 2 + + if (-e dart_ics ) then + ${MOVE} dart_ics $darticname + else + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + exit 2 + endif + endif + + @ instance++ +end + +#----------------------------------------------------------------------------- +# Run filter ... +#----------------------------------------------------------------------------- + +${REMOVE} tiegcm_restart_p.nc tiegcm_s.nc tiegcm.nml + +${LINK} tiegcm_restart_p.nc.0001 tiegcm_restart_p.nc || exit 3 +${LINK} tiegcm_s.nc.0001 tiegcm_s.nc || exit 3 +${LINK} tiegcm.nml.0001 tiegcm.nml || exit 3 + +${MPI_RUN_CMD} ./filter || exit 3 + +#----------------------------------------------------------------------------- +# At this point, all the restart,diagnostic files are in the run/CENTRALDIR. +# You may want to move them to someplace more 'permanent'. +# +# TJH: At this point, the output files have pretty 'generic' names. +# The files could be archived with the assimilation date in their name. +#----------------------------------------------------------------------------- + +# ${COPY} tiegcm.nml ${EXPERIMENT}/tiegcm +# ${MOVE} tiegcm_s.nc* ${EXPERIMENT}/tiegcm +# ${MOVE} tiegcm_restart_p.nc* ${EXPERIMENT}/tiegcm +# ${MOVE} tiegcm_out_* ${EXPERIMENT}/tiegcm + +# ${MOVE} analysis.nc ${EXPERIMENT}/DART +# ${MOVE} preassim.nc ${EXPERIMENT}/DART +# ${MOVE} obs_seq.final ${EXPERIMENT}/DART +# ${MOVE} dart_log.out ${EXPERIMENT}/DART + +# Good style dictates that you save the scripts so you can see what worked. + +# ${COPY} input.nml ${EXPERIMENT}/DART +# ${COPY} *.csh ${EXPERIMENT}/DART +# ${COPY} $myname ${EXPERIMENT}/DART + +echo "${JOBNAME} ($JOBID) finished at "`date` +echo "These are the files in the run directory at completion:" +ls -lrt + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/models/tiegcm/shell_scripts_gadi/run_filter_async4.csh b/models/tiegcm/shell_scripts_gadi/run_filter_async4.csh new file mode 100755 index 0000000000..b868afce08 --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/run_filter_async4.csh @@ -0,0 +1,415 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ +# +##------------------------------------------------------------------------------ +## This block of directives constitutes the preamble for the PBS queuing system +## +## the normal way to submit to the queue is: qsub run_filter.csh +## +## an explanation of the most common directives follows: +## -N Job name +## -r n Declare job non-rerunable +## -e filename for standard error +## -o filename for standard out +## -q Queue name (small, medium, long, verylong) +## -l nodes=xx:ppn=2 requests BOTH processors on the node. On both bangkok +## and calgary, there is no way to 'share' the processors +## on the node with another job, so you might as well use +## them both. (ppn == Processors Per Node) +## +#PBS -P n23 +#PBS -l walltime=3:00:00 +#PBS -l wd +#PBS -l ncpus=16 +#PBS -l mem=32GB +#PBS -N run_tiegcm_assim_gadi +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe + +#=============================================================================== + +# Load required modules +module load openmpi +module load netcdf/4.7.3 +module load hdf5 + +if ($?PBS_O_HOST) then + + setenv ORIGINALDIR `pwd` + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv MYQUEUE $PBS_QUEUE + setenv MYHOST $HOSTNAME + setenv MPI_RUN_CMD mpirun + + # MP_DEBUG_NOTIMEOUT may alleviate MPI timeouts that may occur under + # certain task geometries. It is NOT a good idea to use it in general. + # setenv MP_DEBUG_NOTIMEOUT yes + +else + + #------------------------------------------------------------------- + # You can run this interactively to check syntax, file motion, etc. + #------------------------------------------------------------------- + + setenv ORIGINALDIR `pwd` + setenv JOBNAME tiegcm_filter + setenv JOBID $$ + setenv MYQUEUE Interactive + setenv MYHOST $HOST + setenv MPI_RUN_CMD '' + +endif + +#---------------------------------------------------------------------- +# Just an echo of job attributes +#---------------------------------------------------------------------- + +echo +echo "${JOBNAME} ($JOBID) submitted from $ORIGINALDIR" +echo "${JOBNAME} ($JOBID) submitted from $MYHOST" +echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE" +echo "${JOBNAME} ($JOBID) running on $MYHOST" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +#---------------------------------------------------------------------- +# Make a unique, (empty, clean) temporary directory. +#---------------------------------------------------------------------- + +#setenv CENTRALDIR /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/${JOBNAME}/job_${JOBID} +cd ../../.. +setenv CENTRALDIR `pwd`/${JOBNAME}/job_${JOBID} + +mkdir -p ${CENTRALDIR} +cd ${CENTRALDIR} + +set myname = $0 # this is the name of this script + +# some systems don't like the -v option to any of the following + +set OSTYPE = `uname -s` +switch ( ${OSTYPE} ) + case IRIX64: + setenv REMOVE 'rm -rf' + setenv COPY 'cp -p' + setenv MOVE 'mv -f' + setenv LINK 'ln -s' + breaksw + case AIX: + setenv REMOVE 'rm -rf' + setenv COPY 'cp -p' + setenv MOVE 'mv -f' + setenv LINK 'ln -s' + breaksw + default: + setenv REMOVE 'rm -rvf' + setenv COPY 'cp -v' + setenv MOVE 'mv -fv' + setenv LINK 'ln -s' + breaksw +endsw + +echo "${JOBNAME} ($JOBID) CENTRALDIR == $CENTRALDIR" + +# Set variables containing various directory names where we will GET things +# DARTDIR The location of the DART tiegcm model directory +# TIEGCMDIR The location of the TIEGCM executable +# ENSEMBLEDIR The location of the initial ensemble of TIEGCM files +# EXPERIMENT The (safe) location for the results of this run. +#----------------------------------------------------------------------------- + +set DARTDIR = /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/models/tiegcm +set TIEGCMDIR = /scratch/n23/gwb112/swm_project/TIEGCM +set TIEGCMDATA = ${TIEGCMDIR}/tiegcm_res5.0_data +#set EXPERIMENT = /scratch/n23/gwb112/swm_project/gold_test/initial +#set ENSEMBLEDIR = /scratch/n23/gwb112/swm_project/gold_test/initial +#set EXPERIMENT = /scratch/n23/gwb112/swm_project/gold_test_restart/initial +#set ENSEMBLEDIR = /scratch/n23/gwb112/swm_project/gold_test_restart/initial +#set EXPERIMENT = /scratch/n23/gwb112/swm_project/gold_test_large/initial +#set ENSEMBLEDIR = /scratch/n23/gwb112/swm_project/gold_test_large/initial +#set EXPERIMENT = /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/run_tiegcm_assim_gadi/job_14647484.gadi-pbs +#set ENSEMBLEDIR = /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/run_tiegcm_assim_gadi/job_14647484.gadi-pbs +set EXPERIMENT = /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/run_tiegcm_assim_gadi/job_15037203.gadi-pbs +set ENSEMBLEDIR = /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/run_tiegcm_assim_gadi/job_15037203.gadi-pbs + +# Need to set TGCMDATA environment variable +setenv TGCMDATA $TIEGCMDATA + +#----------------------------------------------------------------------------- +# Get the DART executables, scripts, and input files +# Get the tiegcm executable, control files, and data files. +# The tiegcm initial conditions are in the next block. +#----------------------------------------------------------------------------- + +${COPY} ${DARTDIR}/work/filter . || exit 1 +${COPY} ${DARTDIR}/work/dart_to_model . || exit 1 +${COPY} ${DARTDIR}/work/model_to_dart . || exit 1 +${COPY} ${DARTDIR}/work/input.nml input.nml.original || exit 1 +${COPY} ${DARTDIR}/shell_scripts_gadi/advance_model.csh . || exit 1 +${COPY} ${DARTDIR}/work/wakeup_filter . || exit 1 + +#${COPY} ${EXPERIMENT}/observation/obs_seq.out . || exit 1 +${COPY} ${EXPERIMENT}/obs_seq.out . || exit 1 +${COPY} ${EXPERIMENT}/tiegcm_restart_p.nc . || exit 1 +${COPY} ${EXPERIMENT}/tiegcm_s.nc . || exit 1 +${COPY} ${EXPERIMENT}/tiegcm.nml tiegcm.nml.original || exit 1 +${COPY} ${EXPERIMENT}/gpi*.nc.* . || exit 1 +${COPY} ${EXPERIMENT}/imf*.nc.* . || exit 1 + +${COPY} ${TIEGCMDIR}/tiegcm.exec/tiegcm2.0 tiegcm || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/machines.ini . || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/mpirun.command . || exit 1 + +${COPY} ${TIEGCMDATA}/gswm* . || exit 1 +${COPY} ${TIEGCMDATA}/wei05sc.nc . || exit 1 + +#----------------------------------------------------------------------------- +# Put all of the DART initial conditions files and all of the TIEGCM files +# in the CENTRALDIR - preserving the ensemble member ID for each filename. +# The advance_model.csh script will copy the appropriate files for each +# ensemble member into the model advance directory. +# These files may be linked to CENTRALDIR since they get copied to the +# model advance directory. +# +# REQUIREMENTS: for input.nml +# model_nml : tiegcm_restart_file_name = 'tiegcm_restart_p.nc' +# model_nml : tiegcm_secondary_file_name = 'tiegcm_s.nc' +# model_nml : tiegcm_namelist_file_name = 'tiegcm.nml' +# model_to_dart_nml : file_out = 'dart_ics' +#----------------------------------------------------------------------------- +# ensemble_manager_nml : single_restart_file_in = .false. +# filter_nml : async = 4 +# filter_nml : adv_ens_command = './advance_model.csh' +# filter_nml : start_from_restart = .TRUE. +# filter_nml : restart_in_file_name = 'filter_ics' +# filter_nml : restart_out_file_name = 'filter_restart' +#----------------------------------------------------------------------------- +# dart_to_model_nml : file_in = 'dart_restart' +# dart_to_model_nml : file_namelist_out = 'namelist_update' + +sed -e "/ tiegcm_restart_file_name /c\ tiegcm_restart_file_name = 'tiegcm_restart_p.nc'" \ + -e "/ tiegcm_secondary_file_name /c\ tiegcm_secondary_file_name = 'tiegcm_s.nc'" \ + -e "/ tiegcm_namelist_file_name /c\ tiegcm_namelist_file_name = 'tiegcm.nml'" \ + -e "/ file_out /c\ file_out = 'dart_ics'" \ + -e "/ single_restart_file_in /c\ single_restart_file_in = .FALSE." \ + -e "/ async /c\ async = 4" \ + -e "/ adv_ens_command /c\ adv_ens_command = './advance_model.csh'" \ + -e "/ start_from_restart /c\ start_from_restart = .TRUE." \ + -e "/ restart_in_file_name /c\ restart_in_file_name = 'filter_ics'" \ + -e "/ restart_out_file_name /c\ restart_out_file_name = 'filter_restart'" \ + -e "/ file_in /c\ file_in = 'dart_restart'" \ + -e "/ file_namelist_out /c\ file_namelist_out = 'namelist_update'" \ + input.nml.original >! input.nml || exit 2 + +# Determine the number of ensemble members from input.nml, +# it may exist in more than one place. +# Parse out the filter_nml string and see which +# one is immediately after it ... + +if ( ! -e input.nml ) then + echo "ERROR - input.nml does not exist in local directory." + echo "ERROR - input.nml needed to determine number of ensemble members." + exit 1 +endif + +set ENSEMBLESTRING = `grep -A 42 filter_nml input.nml | grep ens_size` +set NUM_ENS = `echo $ENSEMBLESTRING[3] | sed -e "s#,##"` + +# FIXME ... read the async value from input.nml and set parallel_model accordingly. +# if async=2, e.g. you are going to run './modelxxx', single process +# (or possibly 'mpirun -np 1 ./modelxxx'), so each processor advances +# one ensemble independently of the others, leave this as false. +# +# if async=4, e.g. all the processors advance each modelxxx in turn with +# mpirun -np 64 modelxxx (or whatever) for as many ensembles as you have, +# set this to "true" + +set parallel_model = "true" + +# A common strategy for the beginning is to check for the existence of +# some variables that get set by the different queuing mechanisms. +# This way, we know which queuing mechanism we are working with, +# and can set 'queue-independent' variables for use for the remainder +# of the script. + +if ($?LS_SUBCWD) then + + # LSF has a list of processors already in a variable (LSB_HOSTS) + # alias submit 'bsub < \!*' + echo "LSF - using mpirun.lsf for execution" + setenv MPICMD mpirun.lsf + +else if ($?PBS_O_WORKDIR) then + + # PBS has a list of processors in a file whose name is (PBS_NODEFILE) + # alias submit 'qsub \!*' + echo "PBS - using mpirun for execution" + setenv MPICMD mpirun + +else + + # If you have a linux cluster with no queuing software, use this + # section. The list of computational nodes is given to the mpirun + # command and it assigns them as they appear in the file. In some + # cases it seems to be necessary to wrap the command in a small + # script that changes to the current directory before running. + + echo "running with no queueing system" + + # before running this script, do this once. the syntax is + # node name : how many tasks you can run on it + #setenv MYNODEFILE ~/nodelist + #echo "node7:2" >! $MYNODEFILE + #echo "node5:2" >> $MYNODEFILE + #echo "node3:2" >> $MYNODEFILE + #echo "node1:2" >> $MYNODEFILE + +# one possibility + setenv NUM_PROCS `cat nodelist-pgi | wc -l` + set MPIRUN = /apps/openmpi/4.0.2/bin/mpirun + set MPICMD = $MPIRUN -np $NUM_PROCS -nolocal -machinefile nodelist-pgi + + echo "MPICMD = ${MPICMD}" + +endif + +@ instance = 1 +while ( $instance <= $NUM_ENS ) + + set darticname = `printf "filter_ics.%04d" $instance` + set tiesecond = `printf "tiegcm_s.nc.%04d" $instance` + set tierestart = `printf "tiegcm_restart_p.nc.%04d" $instance` + set tieinp = `printf "tiegcm.nml.%04d" $instance` + + ${COPY} ${ENSEMBLEDIR}/$tiesecond . || exit 2 + ${COPY} ${ENSEMBLEDIR}/$tierestart . || exit 2 + ${COPY} ${ENSEMBLEDIR}/$tieinp tiegcm.nml.original || exit 2 + + # Ensure that the tiegcm.nml for all the ensemble members is identical + # in all the ways that matter. This will result in a miniumum of changes + # in the advance_model.csh script. This script REQUIRES that there is a + # SINGLE tiegcm_restart_p.nc. Just keep appending all the timesteps to + # the same file. If you need to subset the large file, use the NCO + # operators. for example ncks -d time,20,30 tiegcm_restart_p.nc bob.nc + # If you need more than 300 timesteps in the file, increase it here. + + sed -e 's/;.*//' -e '/^$/ d' \ + -e "/ MXHIST_PRIM /c\ MXHIST_PRIM = 300" \ + -e "/ MXHIST_SECH /c\ MXHIST_SECH = 300" \ + -e "/ SOURCE /c\ SOURCE = 'tiegcm_restart_p.nc'" \ + -e "/ OUTPUT /c\ OUTPUT = 'tiegcm_restart_p.nc'" \ + -e "/ SECOUT /c\ SECOUT = 'tiegcm_s.nc'" \ + tiegcm.nml.original >! $tieinp || exit 2 + + # If an existing ensemble of filter_ics.#### exist, use it. + # If not, generate one. Be aware - even if they exist, they may + # not have the same variable set as your current input.nml + # If that is the case, you will have to generate your own set anyway. + # If you get an error from aread_state_restart(), this is likely the case. + + if ( -e ${ENSEMBLEDIR}/initial/$darticname.GENERATE ) then + ${REMOVE} $darticname + ${LINK} ${ENSEMBLEDIR}/initial/$darticname . || exit 2 + else + # We must convert a tiegcm_restart_p.nc file to a dart_ics file + # for each ensemble member. So - momentarily, we must + # create links to the static filenames expected by model_to_dart + + ${REMOVE} tiegcm_restart_p.nc tiegcm_s.nc tiegcm.nml + + ${LINK} $tierestart tiegcm_restart_p.nc || exit 2 + ${LINK} $tiesecond tiegcm_s.nc || exit 2 + ${LINK} $tieinp tiegcm.nml || exit 2 + + ./model_to_dart || exit 2 + + if (-e dart_ics ) then + ${MOVE} dart_ics $darticname + else + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + exit 2 + endif + endif + + @ instance++ +end + +#------------------------------------------------------------------------------- +# Everything below this separator should not need to be modified if everything +# above the separator is set correctly. +#------------------------------------------------------------------------------- + +if ( "$parallel_model" == "false" ) then + + # each filter task advances the ensembles, each running on 1 proc. + + ${MPICMD} ./filter + +else + + # filter runs in parallel until time to do a model advance, + # and then this script starts up the modelxxx jobs, each one + # running in parallel. then it runs wakeup_filter to wake + # up filter so it can continue. The communication happens through + # 'named pipes' created by the mkfifo command. + + \rm -f model_to_filter.lock filter_to_model.lock + mkfifo model_to_filter.lock filter_to_model.lock + + set filterhome = ~/.filter$$ + if ( ! -e $filterhome) mkdir $filterhome + + # start filter and immediately return control back to this script + + (setenv HOME $filterhome; ${MPICMD} ./filter) & + + while ( -e filter_to_model.lock ) + + set todo=`cat < filter_to_model.lock` + echo "todo received, value = ${todo}" + + if ( "${todo}" == "finished" ) then + echo "main script: filter done." + wait + break + + else if ( "${todo}" == "advance" ) then + + # FIXME : in input.nml, the advance model command must + # have -np N with N equal to the number of processors this job is using. + + echo "calling model advance now:" + ./advance_model.csh 0 ${NUM_ENS} filter_control00000 || exit 9 + + echo "restarting filter." + ${MPICMD} ./wakeup_filter + + else + echo "main script: unexpected value received." + break + endif + end + + echo "filter finished, removing pipes." + \rm -f model_to_filter.lock filter_to_model.lock + + if ( -d $filterhome) \rmdir $filterhome + +endif + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/models/tiegcm/shell_scripts_gadi/run_perfect_model_obs.csh b/models/tiegcm/shell_scripts_gadi/run_perfect_model_obs.csh new file mode 100755 index 0000000000..b7bd3367f6 --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/run_perfect_model_obs.csh @@ -0,0 +1,253 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ +# +# Top level script to generate observations and a TRUE state. +# +# This script is designed to be submitted as a batch job but may be run from +# the command line (as a single thread) to check for file motion, etc. +# If running interactively, please comment out the part that actually runs filter. +# +#----------------------------------------------------------------------------- +#PBS -P n23 +#PBS -l walltime=3:00:00 +#PBS -l wd +#PBS -l ncpus=16 +#PBS -l mem=32GB +#PBS -N run_tiegcm_assim_gadi +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe + +#---------------------------------------------------------------------- +# Turns out the scripts are a lot more flexible if you don't rely on +# the queuing-system-specific variables -- so I am converting them to +# 'generic' names and using the generics throughout the remainder. +#---------------------------------------------------------------------- + +if ($?LSB_HOSTS) then + + setenv ORIGINALDIR $LS_SUBCWD + setenv JOBNAME $LSB_JOBNAME + setenv JOBID $LSB_JOBID + setenv MYQUEUE $LSB_QUEUE + setenv MYHOST $LSB_SUB_HOST + +else + + #------------------------------------------------------------------- + # You can run this interactively to check syntax, file motion, etc. + #------------------------------------------------------------------- + + setenv ORIGINALDIR `pwd` + setenv JOBNAME tiegcm_perfect + setenv JOBID $$ + setenv MYQUEUE Interactive + setenv MYHOST $HOST + +endif + +#---------------------------------------------------------------------- +# Just an echo of job attributes +#---------------------------------------------------------------------- + +echo +echo "${JOBNAME} ($JOBID) submitted from $ORIGINALDIR" +echo "${JOBNAME} ($JOBID) submitted from $MYHOST" +echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE" +echo "${JOBNAME} ($JOBID) running on $MYHOST" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +#---------------------------------------------------------------------- +# Make a unique, (empty, clean) temporary directory. +#---------------------------------------------------------------------- + +#setenv CENTRALDIR /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/${JOBNAME}/job_${JOBID} +cd ../../.. +setenv CENTRALDIR `pwd`/${JOBNAME}/job_${JOBID} + +mkdir -p ${CENTRALDIR} +cd ${CENTRALDIR} + +set myname = $0 # this is the name of this script + +# some systems don't like the -v option to any of the following + +set OSTYPE = `uname -s` +switch ( ${OSTYPE} ) + case IRIX64: + setenv REMOVE 'rm -rf' + setenv COPY 'cp -p' + setenv MOVE 'mv -f' + setenv LINK 'ln -s' + breaksw + case AIX: + setenv REMOVE 'rm -rf' + setenv COPY 'cp -p' + setenv MOVE 'mv -f' + setenv LINK 'ln -s' + breaksw + default: + setenv REMOVE 'rm -rvf' + setenv COPY 'cp -v' + setenv MOVE 'mv -fv' + setenv LINK 'ln -s' + breaksw +endsw + +echo "${JOBNAME} ($JOBID) CENTRALDIR == $CENTRALDIR" + +#----------------------------------------------------------------------------- +# Set variables containing various directory names where we will GET things +# DARTDIR The location of the DART tiegcm model directory +# TIEGCMDIR The location of the TIEGCM executable +# ENSEMBLEDIR The location of the initial ensemble of TIEGCM files +# EXPERIMENT The (safe) location for the results of this run. +#----------------------------------------------------------------------------- + +set DARTDIR = /scratch/n23/gwb112/swm_project/DART/dart_tiegcm/models/tiegcm +set TIEGCMDIR = /scratch/n23/gwb112/swm_project/TIEGCM +set TIEGCMDATA = ${TIEGCMDIR}/tiegcm_res5.0_data +set EXPERIMENT = /scratch/n23/gwb112/swm_project/gold_test +set ENSEMBLEDIR = /scratch/n23/gwb112/swm_project/gold_test/initial + +#----------------------------------------------------------------------------- +# Get the DART executables, scripts, and input files +# Get the tiegcm executable, control files, and data files. +# The tiegcm initial conditions are in the next block. +#----------------------------------------------------------------------------- + +${COPY} ${DARTDIR}/work/perfect_model_obs . || exit 1 +${COPY} ${DARTDIR}/work/dart_to_model . || exit 1 +${COPY} ${DARTDIR}/work/model_to_dart . || exit 1 +${COPY} ${DARTDIR}/work/input.nml input.nml.original || exit 1 +${COPY} ${DARTDIR}/shell_scripts_gadi/advance_model.csh . || exit 1 +${COPY} ${DARTDIR}/work/obs_seq.in . || exit 1 + +${COPY} ${EXPERIMENT}/initial/obs_seq.out . || exit 1 +${COPY} ${EXPERIMENT}/initial/tiegcm_restart_p.nc . || exit 1 +${COPY} ${EXPERIMENT}/initial/tiegcm_s.nc . || exit 1 +${COPY} ${EXPERIMENT}/initial/tiegcm.nml tiegcm.nml.original || exit 1 +${COPY} ${EXPERIMENT}/initial/gpi*.nc.* . || exit 1 +${COPY} ${EXPERIMENT}/initial/imf*.nc.* . || exit 1 + +${COPY} ${TIEGCMDIR}/tiegcm.exec/tiegcm2.0 tiegcm || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/machines.ini . || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/mpirun.command . || exit 1 + +${COPY} ${TIEGCMDATA}/gswm* . || exit 1 +${COPY} ${TIEGCMDATA}/wei05sc.nc . || exit 1 + +${COPY} ${ENSEMBLEDIR}/tiegcm_restart_p.nc . || exit 1 +${COPY} ${ENSEMBLEDIR}/tiegcm_s.nc . || exit 1 +${COPY} ${ENSEMBLEDIR}/tiegcm.nml tiegcm.nml.original || exit 1 + +#----------------------------------------------------------------------------- +# Remove all the comments that follow (;) symbol from tiegcm.nml namelist file +# That is a non-standard syntax for fortran namelists. +# +# Ensure that the tiegcm.nml for all the ensemble members is identical +# in all the ways that matter. This will result in a miniumum of changes +# in the advance_model.csh script. This script REQUIRES that there is a +# SINGLE tiegcm_restart_p.nc. Just keep appending all the timesteps to +# the same file. If you need to subset the large file, use the NCO +# operators. for example ncks -d time,20,30 tiegcm_restart_p.nc bob.nc +# If you need more than 300 timesteps in the file, increase it here. +#----------------------------------------------------------------------------- + +sed -e 's/;.*//' -e '/^$/ d' \ + -e "/ MXHIST_PRIM /c\ MXHIST_PRIM = 300" \ + -e "/ MXHIST_SECH /c\ MXHIST_SECH = 300" \ + -e "/ SOURCE /c\ SOURCE = 'tiegcm_restart_p.nc'" \ + -e "/ OUTPUT /c\ OUTPUT = 'tiegcm_restart_p.nc'" \ + -e "/ SECOUT /c\ SECOUT = 'tiegcm_s.nc'" \ + tiegcm.nml.original >! tiegcm.nml || exit 2 + +#----------------------------------------------------------------------------- +# Convert a TIEGCM file 'tiegcm_restart.nc' to a DART ics file 'dart_ics' +# There are some requirements for this script and advance_model.csh. +# The requirements for this script are enforced here, the requirements for +# advance_model.csh are enforced there. +# +# REQUIREMENTS: for input.nml +# model_nml : tiegcm_restart_file_name = 'tiegcm_restart_p.nc' +# model_nml : tiegcm_secondary_file_name = 'tiegcm_s.nc' +# model_nml : tiegcm_namelist_file_name = 'tiegcm.nml' +# model_to_dart_nml : file_out = 'dart_ics' +#----------------------------------------------------------------------------- +# perfect_model_obs_nml: async = 2 +# perfect_model_obs_nml: adv_ens_command = 'advance_model.csh' +# perfect_model_obs_nml: start_from_restart = .TRUE. +# perfect_model_obs_nml: restart_in_file_name = 'dart_ics' +#----------------------------------------------------------------------------- +# dart_to_model_nml : file_in = 'dart_restart' +# dart_to_model_nml : file_namelist_out = 'namelist_update' + +sed -e "/ tiegcm_restart_file_name /c\ tiegcm_restart_file_name = 'tiegcm_restart_p.nc'" \ + -e "/ tiegcm_secondary_file_name /c\ tiegcm_secondary_file_name = 'tiegcm_s.nc'" \ + -e "/ tiegcm_namelist_file_name /c\ tiegcm_namelist_file_name = 'tiegcm.nml'" \ + -e "/ file_out /c\ file_out = 'dart_ics'" \ + -e "/ async /c\ async = 2" \ + -e "/ adv_ens_command /c\ adv_ens_command = './advance_model.csh'" \ + -e "/ start_from_restart /c\ start_from_restart = .TRUE." \ + -e "/ restart_in_file_name /c\ restart_in_file_name = 'dart_ics'" \ + -e "/ file_in /c\ file_in = 'dart_restart'" \ + -e "/ file_namelist_out /c\ file_namelist_out = 'namelist_update'" \ + input.nml.original >! input.nml || exit -3 + +./model_to_dart || exit 2 + +#----------------------------------------------------------------------------- +# Run perfect_model_obs ... harvest the observations to populate obs_seq.out +# model_mod expects a generic name // advance_model.csh expects a filename +# with the ensemble member ID tacked on - must provide both. +#----------------------------------------------------------------------------- + +${REMOVE} tiegcm_restart_p.nc.0001 tiegcm_s.nc.0001 tiegcm.nml.0001 + +${LINK} tiegcm_restart_p.nc tiegcm_restart_p.nc.0001 || exit 3 +${LINK} tiegcm_s.nc tiegcm_s.nc.0001 || exit 3 +${LINK} tiegcm.nml tiegcm.nml.0001 || exit 3 + + +./perfect_model_obs || exit 3 + +#----------------------------------------------------------------------------- +# At this point, all the restart,diagnostic files are in the run/CENTRALDIR. +# You may want to move them to someplace more 'permanent'. +# +# TJH: At this point, the output files have pretty 'generic' names. +# The files could be archived with the assimilation date in their name. +#----------------------------------------------------------------------------- + +# ${MOVE} tiegcm_s.nc.0001 ${EXPERIMENT}/perfect/tiegcm_s.nc +# ${MOVE} tiegcm_restart_p.nc.0001 ${EXPERIMENT}/perfect/tiegcm_restart_p.nc +# ${MOVE} tiegcm.nml ${EXPERIMENT}/perfect +# ${MOVE} obs_seq.out ${EXPERIMENT}/perfect +# ${MOVE} True_State.nc ${EXPERIMENT}/perfect + +# ${MOVE} tiegcm_out_1 ${EXPERIMENT}/perfect/tiegcm_out +# ${MOVE} dart_log.out ${EXPERIMENT}/perfect +# ${MOVE} dart_log.nml ${EXPERIMENT}/perfect +# Good style dictates that you save the scripts so you can see what worked. + +# ${COPY} input.nml ${EXPERIMENT}/DART +# ${COPY} *.csh ${EXPERIMENT}/DART +# ${COPY} $myname ${EXPERIMENT}/DART + +echo "${JOBNAME} ($JOBID) finished at "`date` +echo "These are the files in the run directory at completion:" +ls -lrt + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/models/tiegcm/shell_scripts_gadi/stage_experiment.csh b/models/tiegcm/shell_scripts_gadi/stage_experiment.csh new file mode 100755 index 0000000000..524ba93ed3 --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/stage_experiment.csh @@ -0,0 +1,297 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# The intent of this script is to create a single 'CENTRALDIR' directory that +# has sub-directories for each of the TIE-GCM model instances. All instances +# should be assumed to run simultaneously, so each directory should be entirely +# independent. If there are readonly resources, those can be linked instead +# of being copied. +# +# This script should only need to be run once per experiment. +# The intended workflow is: +# 0) stage the experiment (by running this script) +# 1) configure and run (interactively) the XXXXX script to submit a series of +# dependent jobs. +# Job 1) a job array that will dispatch N jobs where each job will advance +# a single ensemble member +# Job 2) If Job1 terminates normally, Job2 will run the assimilation. +# Job 3) same as Job 1 ... +# Job 4) same as Job 2 ... +# ... +# +##------------------------------------------------------------------------------ +## This block of directives constitutes the preamble for the PBS queuing system +## +## the normal way to submit to the queue is: qsub run_filter.csh +## +## an explanation of the most common directives follows: +## -N Job name +## -r n Declare job non-rerunable +## -e filename for standard error +## -o filename for standard out +## -q Queue name (small, medium, long, verylong) +## -l nodes=xx:ppn=2 requests BOTH processors on the node. On both bangkok +## and calgary, there is no way to 'share' the processors +## on the node with another job, so you might as well use +## them both. (ppn == Processors Per Node) +## +#PBS -P n23 +#PBS -l walltime=0:10:00 +#PBS -l wd +#PBS -l ncpus=1 +#PBS -l mem=32GB +#PBS -N stage_files +#PBS -m ae +#PBS -M g.bowden@adfa.edu.au +#PBS -j oe + +#=============================================================================== + +if ($?PBS_O_HOST) then + + setenv ORIGINALDIR `pwd` + setenv JOBNAME $PBS_JOBNAME + setenv JOBID $PBS_JOBID + setenv MYQUEUE $PBS_QUEUE + setenv MYHOST $HOSTNAME + +else + + #------------------------------------------------------------------- + # You can run this interactively to check syntax, file motion, etc. + #------------------------------------------------------------------- + + setenv ORIGINALDIR `pwd` + setenv JOBNAME stage_files + setenv JOBID $$ + setenv MYQUEUE Interactive + setenv MYHOST $HOST + +endif + +#---------------------------------------------------------------------- +# Just an echo of job attributes +#---------------------------------------------------------------------- + +echo +echo "${JOBNAME} ($JOBID) submitted from $ORIGINALDIR" +echo "${JOBNAME} ($JOBID) submitted from $MYHOST" +echo "${JOBNAME} ($JOBID) running in queue $MYQUEUE" +echo "${JOBNAME} ($JOBID) running on $MYHOST" +echo "${JOBNAME} ($JOBID) started at "`date` +echo + +setenv BASE /scratch/n23/gwb112/swm_project/DART/dart_tiegcm +setenv BASE /Users/thoar/git/DART_tiegcm +setenv CENTRALDIR ${BASE}/${JOBNAME}/job_${JOBID} + +mkdir -p ${CENTRALDIR} + +# Archive a copy of the script in the experiment directory +set myname = $0 +cp ${myname} ${CENTRALDIR}/${myname}.original + +cd ${CENTRALDIR} + +#---------------------------------------------------------------------- +# Make a 'resource file' that has all the variables for this experiment +#---------------------------------------------------------------------- + +# variables containing various directory names where we will GET things + +# DARTDIR The location of the DART tiegcm model directory +# TIEGCMDIR The location of the TIEGCM executable +# ENSEMBLEDIR The location of the initial ensemble of TIEGCM files +# EXPERIMENT The (safe) location for the results of this run. + +cat << EndOfText >! DART_params.csh +#!/bin/csh +# Resource file for a DART experiment + +# Load required modules +module load openmpi +module load netcdf/4.7.3 +module load hdf5 + +setenv REMOVE 'rm -rf' +setenv COPY 'cp -p' +setenv MOVE 'mv -f' +setenv LINK 'ln -s' + +setenv BASE ${BASE} +setenv CENTRALDIR ${CENTRALDIR} + +echo "${JOBNAME} ($JOBID) CENTRALDIR == \${CENTRALDIR}" + +setenv TIEGCMDIR /scratch/n23/gwb112/swm_project/TIEGCM +setenv TGCMDATA \${TIEGCMDIR}/tiegcm_res5.0_data + +setenv DARTDIR \${BASE}/models/tiegcm +setenv EXPERIMENT \${BASE}/run_tiegcm_assim_gadi/job_15037203.gadi-pbs +setenv ENSEMBLEDIR \${BASE}/run_tiegcm_assim_gadi/job_15037203.gadi-pbs +EndOfText + +# make the resource file executable +chmod 755 DART_params.csh + +# We need some of those resources, this makes them available. +source DART_params.csh + +#----------------------------------------------------------------------------- +# Populate the CENTRALDIR with everything that is common to all instances. +# Get the DART executables, scripts, and input files +# Get the tiegcm executable, control files, and data files. +# The individual ensemble member directories will be populated in a loop below. +#----------------------------------------------------------------------------- + +${COPY} ${DARTDIR}/work/filter . || exit 1 +${COPY} ${DARTDIR}/work/dart_to_model . || exit 1 +${COPY} ${DARTDIR}/work/model_to_dart . || exit 1 +${COPY} ${DARTDIR}/work/advance_time . || exit 1 +${COPY} ${DARTDIR}/work/obs_sequence_tool . || exit 1 +${COPY} ${DARTDIR}/work/input.nml . || exit 1 +${COPY} ${DARTDIR}/shell_scripts_gadi/submit_multiple_cycles.csh . || exit 1 + +# Determine the number of ensemble members from input.nml, +# it may exist in more than one place. +# Parse out the filter_nml string and see which +# one is immediately after it ... + +if ( ! -e input.nml ) then + echo "ERROR - input.nml does not exist in local directory." + echo "ERROR - input.nml needed to determine number of ensemble members." + exit 1 +endif + +set ENSEMBLESTRING = `grep -A 42 filter_nml input.nml | grep ens_size` +set NUM_ENS = `echo $ENSEMBLESTRING[3] | sed -e "s#,##"` + +# Need to convey the location of the experiment to the following scripts. +# Would not need to, but for a quirk of PBS. + +sed -e "s/CENTRALDIRSTRING/$CENTRALDIR/" \ + ${DARTDIR}/shell_scripts_gadi/assimilate.csh assimilate.csh || exit 1 +sed -e "s/CENTRALDIRSTRING/$CENTRALDIR/" \ + -e "s/CENSEMBLESIZESTRING/$ens_size/" \ + ${DARTDIR}/shell_scripts_gadi/advance_tiegcm.csh advance_tiegcm.csh || exit 1 + +${COPY} ${EXPERIMENT}/obs_seq.out . || exit 1 +${COPY} ${EXPERIMENT}/tiegcm_restart_p.nc . || exit 1 +${COPY} ${EXPERIMENT}/tiegcm_s.nc . || exit 1 +${COPY} ${EXPERIMENT}/tiegcm.nml tiegcm.nml.original || exit 1 +${COPY} ${EXPERIMENT}/gpi*.nc.* . || exit 1 +${COPY} ${EXPERIMENT}/imf*.nc.* . || exit 1 + +${COPY} ${TIEGCMDIR}/tiegcm.exec/tiegcm2.0 tiegcm || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/machines.ini . || exit 1 +${COPY} ${TIEGCMDIR}/tiegcm.exec/mpirun.command . || exit 1 + +${COPY} ${TGCMDATA}/gswm* . || exit 1 +${COPY} ${TGCMDATA}/wei05sc.nc . || exit 1 + +#----------------------------------------------------------------------------- +# Make a unique directory for each model instance ... populate that +# directory with everything a TIE-GCM instance needs to run. If there +# are readonly resources, they can be 'linked' into the directory. + +@ instance = 1 +while ( $instance <= $NUM_ENS ) + + echo "Staging ensemble member $instance of $NUM_ENS at "`date` + + set rundir = `printf "instance_%04d" $instance` + mkdir $rundir + cd $rundir + + cp ../input.nml . + + set darticname = `printf "filter_ics.%04d" $instance` + set tiesecond = `printf "tiegcm_s.nc.%04d" $instance` + set tierestart = `printf "tiegcm_restart_p.nc.%04d" $instance` + set tieinp = `printf "tiegcm.nml.%04d" $instance` + + ${COPY} ${ENSEMBLEDIR}/$tiesecond tiegcm_s.nc || exit 2 + ${COPY} ${ENSEMBLEDIR}/$tierestart tiegcm_restart_p.nc || exit 2 + + # Ensure that the tiegcm.nml for all the ensemble members is identical + # in all the ways that matter. + + sed -e 's/;.*//' -e '/^$/ d' \ + -e "/ MXHIST_PRIM /c\ MXHIST_PRIM = 300" \ + -e "/ MXHIST_SECH /c\ MXHIST_SECH = 300" \ + -e "/ SOURCE /c\ SOURCE = 'tiegcm_restart_p.nc'" \ + -e "/ OUTPUT /c\ OUTPUT = 'tiegcm_restart_p.nc'" \ + -e "/ SECOUT /c\ SECOUT = 'tiegcm_s.nc'" \ + ${ENSEMBLEDIR}/$tieinp >! tiegcm.nml || exit 2 + + # If an existing ensemble of filter_ics.#### exist, use it. + # If not, generate one. Be aware - even if they exist, they may + # not have the same variable set as your current input.nml + # If that is the case, you will have to generate your own set anyway. + # If you get an error from aread_state_restart(), this is likely the case. + + if ( -e ${ENSEMBLEDIR}/initial/$darticname.GENERATE ) then + ${REMOVE} $darticname + ${LINK} ${ENSEMBLEDIR}/initial/$darticname . || exit 2 + else + # We must convert a tiegcm_restart_p.nc file to a dart_ics file + # for each ensemble member. + + ../model_to_dart || exit 2 + + if (! -e dart_ics ) then + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + echo "ERROR: File conversion from $tierestart to $darticname failed." + exit 2 + else + ${MOVE} dart_ics $darticname + endif + endif + + cd .. + + # Link the expected input for filter ... + ln -s $rundir/filter_ics $darticname + ln -s $rundir/tiegcm_s.nc $tiesecond + ln -s $rundir/tiegcm_restart_p.nc $tierestart + + @ instance++ + +end + +echo "Finished staging the experiment at "`date` + +#------------------------------------------------------------------------------- +# Create some instructions for what do do next. + +cat << EndOfText >! README.txt + +# REQUIREMENTS: for input.nml +# model_nml : tiegcm_restart_file_name = 'tiegcm_restart_p.nc' +# model_nml : tiegcm_secondary_file_name = 'tiegcm_s.nc' +# model_nml : tiegcm_namelist_file_name = 'tiegcm.nml' +# model_to_dart_nml : file_out = 'dart_ics' +#----------------------------------------------------------------------------- +# ensemble_manager_nml : single_restart_file_in = .false. +# filter_nml : async = 0 +# filter_nml : adv_ens_command = './no_advance_model.csh' +# filter_nml : start_from_restart = .TRUE. +# filter_nml : restart_in_file_name = 'filter_ics' +# filter_nml : restart_out_file_name = 'filter_restart' +#----------------------------------------------------------------------------- +# dart_to_model_nml : file_in = 'dart_restart' +# dart_to_model_nml : file_namelist_out = 'namelist_update' + +1) cd ${CENTRALDIR} +2) check namelists +3) ./submit_multiple_cycles 3 + +EndOfText + +cat README.txt + +exit 0 diff --git a/models/tiegcm/shell_scripts_gadi/submit_multiple_cycles.csh b/models/tiegcm/shell_scripts_gadi/submit_multiple_cycles.csh new file mode 100755 index 0000000000..df8cf829ed --- /dev/null +++ b/models/tiegcm/shell_scripts_gadi/submit_multiple_cycles.csh @@ -0,0 +1,75 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +#========================================================================== +# +# This utility launches a series of dependent jobs for the SLURM scheduler to +# accomodate a cycling experiment. Multiple jobs get queued, but only run if +# the previous job completes successfully. +# +# The first dependent job is a job array where each model advance is run in +# a separate job. When ALL of those jobs (i.e. the entire job array) is +# successfully complete, the assimilation job starts. When that job finishes, +# the next job array of advances starts ... and so on. +# +# The resources for the model advance jobs are specified in advance_ensemble.csh +# The resources for the assimilation job is specified in run_filter.csh +# Each resource can be tailored separately for maximum efficiency. +# +# This utility is designed to be run interactively from the CENTRALDIR + +set NCYCLES = 11 + +if ( -e DART_params.csh ) then + source DART_params.csh +else + echo "ERROR: resource file 'DART_params.csh' not found." + echo " need one in "`pwd` + exit 1 +endif + +#-------------------------------------------------------------------------- +# Overall strategy is to fire off a series of dependent jobs. +# Successful completion of the first filter job will free the queued model +# advances. That successful completion of that job array will free the +# next filter job ... and so on. +#-------------------------------------------------------------------------- + +set depstr = " " +set i = 1 + +while ( $i <= $NCYCLES ) + + echo "queueing cycle $i" + + #----------------------------------------------------------------------- + # run Filter to generate the analysis and capture job ID for dependency + #----------------------------------------------------------------------- + + set submissionstring = `qsub $depstr ./run_filter.csh` + set dajob = `echo $submissionstring | awk '{print($4)}'` + set depstr = "-W depend=afterok:$dajob" + + #----------------------------------------------------------------------- + # launch job array of ensemble advances and capture job ID for dependency + #----------------------------------------------------------------------- + + set submissionstring = `qsub $depstr ./advance_ensemble.csh` + set ensjob = `echo $submissionstring | awk '{print($4)}'` + set depstr = "-W depend=afterok:$ensjob" + + @ i++ + +end + +#----------------------------------------------------------------------- +# run Filter to generate the analysis for the last advance. +#----------------------------------------------------------------------- + +qsub $depstr ./run_filter.csh + +exit 0 + diff --git a/models/tiegcm/work/input.nml b/models/tiegcm/work/input.nml index a88421c653..f97d65346c 100644 --- a/models/tiegcm/work/input.nml +++ b/models/tiegcm/work/input.nml @@ -1,9 +1,10 @@ + &perfect_model_obs_nml start_from_restart = .true. output_restart = .true. - async = 2 - init_time_days = -1 - init_time_seconds = -1 + async = 4 + init_time_days = 152610 + init_time_seconds = 43200 first_obs_days = -1 first_obs_seconds = -1 last_obs_days = -1 @@ -11,7 +12,7 @@ output_interval = 1 restart_in_file_name = "perfect_ics" restart_out_file_name = "perfect_restart" - obs_seq_in_file_name = "obs_seq.in" + obs_seq_in_file_name = "../bowden/18Dec2020/obs_seq.out.all" obs_seq_out_file_name = "obs_seq.out" adv_ens_command = "./advance_model.csh" output_timestamps = .false. @@ -22,9 +23,9 @@ / &filter_nml - async = 2 - adv_ens_command = "./advance_model.csh" - ens_size = 80 + async = 0 + adv_ens_command = "unable_to_advance_model.csh" + ens_size = 4 start_from_restart = .true. output_restart = .true. obs_sequence_in_name = "obs_seq.out" @@ -37,8 +38,8 @@ first_obs_seconds = -1 last_obs_days = -1 last_obs_seconds = -1 - num_output_state_members = 80 - num_output_obs_members = 80 + num_output_state_members = 4 + num_output_obs_members = 4 output_interval = 1 num_groups = 1 input_qc_threshold = 3.0 @@ -58,11 +59,11 @@ inf_out_file_name = 'prior_inflate_restart', 'post_inflate_restart' inf_diag_file_name = 'prior_inflate_diag', 'post_inflate_diag' inf_initial = 1.0, 1.0 - inf_sd_initial = 0.0, 0.0 - inf_damping = 1.0, 1.0 + inf_sd_initial = 0.6, 0.0 + inf_damping = 0.9, 1.0 inf_lower_bound = 1.0, 1.0 - inf_upper_bound = 1000000.0, 1000000.0 - inf_sd_lower_bound = 0.0, 0.0 + inf_upper_bound = 100.0, 10000.0 + inf_sd_lower_bound = 0.6, 0.0 / &smoother_nml @@ -122,23 +123,24 @@ # 'VTEC', 'KIND_VERTICAL_TEC', 'NA', 'NA', 'calculate' 'NO_COPY_BACK' &model_nml - debug = 1 - output_state_vector = .false. + debug = 0 tiegcm_restart_file_name = 'tiegcm_restart_p.nc' tiegcm_secondary_file_name = 'tiegcm_s.nc' tiegcm_namelist_file_name = 'tiegcm.nml' assimilation_period_seconds = 3600 estimate_f10_7 = .false. - variables = 'NE', 'KIND_ELECTRON_DENSITY', '1000.0', 'NA', 'restart', 'UPDATE' - 'OP', 'KIND_DENSITY_ION_OP', 'NA', 'NA', 'restart', 'UPDATE', - 'TI', 'KIND_TEMPERATURE_ION', 'NA', 'NA', 'restart', 'UPDATE', - 'TE', 'KIND_TEMPERATURE_ELECTRON', 'NA', 'NA', 'restart', 'UPDATE', - 'OP_NM', 'KIND_DENSITY_ION_OP', 'NA', 'NA', 'restart', 'UPDATE', - 'O1', 'KIND_ATOMIC_OXYGEN_MIXING_RATIO','0.00001', '0.99999', 'restart', 'NO_COPY_BACK', - 'O2', 'KIND_MOLEC_OXYGEN_MIXING_RATIO', '0.00001', '0.99999', 'restart', 'NO_COPY_BACK', - 'TN', 'KIND_TEMPERATURE', '0.0', '6000.0', 'restart', 'NO_COPY_BACK', - 'ZG', 'KIND_GEOMETRIC_HEIGHT', 'NA', 'NA', 'secondary', 'NO_COPY_BACK', - 'VTEC', 'KIND_VERTICAL_TEC', 'NA', 'NA', 'calculate', 'NO_COPY_BACK' + variables = 'NE', 'KIND_ELECTRON_DENSITY', '1000.0', '1.0e20', 'restart', 'UPDATE' + 'OP', 'KIND_DENSITY_ION_OP', '1.0', '1.0e20', 'restart', 'UPDATE', + 'TI', 'KIND_TEMPERATURE_ION', '100.0', '10000.0', 'restart', 'UPDATE', + 'TE', 'KIND_TEMPERATURE_ELECTRON', '100.0', '10000.0', 'restart', 'UPDATE', + 'OP_NM', 'KIND_DENSITY_ION_OP', '100.0', '10000.0', 'restart', 'UPDATE', + 'O1', 'KIND_ATOMIC_OXYGEN_MIXING_RATIO', '0.00001', '0.99999', 'restart', 'NO_COPY_BACK', + 'O2', 'KIND_MOLEC_OXYGEN_MIXING_RATIO', '0.00001', '0.99999', 'restart', 'NO_COPY_BACK', + 'TN', 'KIND_TEMPERATURE', '0.0', '6000.0', 'restart', 'NO_COPY_BACK', + 'ZG', 'KIND_GEOMETRIC_HEIGHT', '100.0', '1.0e8', 'secondary', 'NO_COPY_BACK', + 'DEN', 'KIND_DENSITY', '0.0', '1.0', 'secondary', 'NO_COPY_BACK', + 'N2', 'KIND_MOLEC_NITROGEN_MIXING_RATIO','0.00001', '0.99999', 'secondary', 'NO_COPY_BACK', + 'VTEC', 'KIND_VERTICAL_TEC', '0.0', '1.0e18', 'calculate', 'NO_COPY_BACK' / &model_to_dart_nml @@ -148,7 +150,7 @@ &dart_to_model_nml file_in = 'dart_restart' file_namelist_out = 'namelist_update' - advance_time_present = .false. + advance_time_present = .true. / &cov_cutoff_nml @@ -167,12 +169,14 @@ / &obs_kind_nml - assimilate_these_obs_types = 'GPS_PROFILE', 'COSMIC_ELECTRON_DENSITY' - evaluate_these_obs_types = 'GND_GPS_VTEC', 'CHAMP_DENSITY', 'GPS_VTEC_EXTRAP' + assimilate_these_obs_types = 'GOLD_TEMPERATURE', + 'GOLD_NEMAX', + 'GOLD_ON2COLUMN', + evaluate_these_obs_types = 'null' / &assim_model_nml - write_binary_restart_files = .true. + write_binary_restart_files = .false. netCDF_large_file_support = .true. / @@ -193,7 +197,9 @@ output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90' input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90' output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90' - input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' + input_files = '../../../obs_def/obs_def_upper_atm_mod.f90', + '../../../obs_def/obs_def_CO_Nadir_mod.f90', + '../../../obs_def/obs_def_GOLD_mod.f90' / &utilities_nml @@ -211,9 +217,9 @@ input_file_name = "filter_restart" output_file_name = "filter_updated_restart" ens_size = 1 - single_restart_file_in = .true. - single_restart_file_out = .true. - write_binary_restart_files = .true. + single_restart_file_in = .false. + single_restart_file_out = .false. + write_binary_restart_files = .false. overwrite_data_time = .false. new_data_days = -1 new_data_secs = -1 @@ -236,11 +242,11 @@ &obs_diag_nml obs_sequence_name = 'obs_seq.final' obs_sequence_list = '' - first_bin_center = 2005, 9, 9, 0, 0, 0 - last_bin_center = 2005, 9, 10, 0, 0, 0 + first_bin_center = 2018, 11, 1, 0, 0, 0 + last_bin_center = 2018, 11, 1, 23, 0, 0 bin_separation = 0, 0, 0, 1, 0, 0 bin_width = 0, 0, 0, 1, 0, 0 - time_to_skip = 0, 0, 0, 1, 0, 0 + time_to_skip = 0, 0, 0, 0, 0, 0 max_num_bins = 1000 trusted_obs = 'null' Nregions = 4 @@ -285,13 +291,12 @@ / &obs_sequence_tool_nml - num_input_files = 1 - filename_seq = 'obs_seq.out' - filename_out = 'obs_seq.processed' - first_obs_days = -1 - first_obs_seconds = -1 - last_obs_days = -1 - last_obs_seconds = -1 + filename_seq = 'obs_seq.input' + filename_out = 'obs_seq.out' + first_obs_days = 152610 + first_obs_seconds = 21600 + last_obs_days = 152610 + last_obs_seconds = 23000 obs_types = '' keep_types = .false. print_only = .false. @@ -308,5 +313,14 @@ verbose = .true. x_ind = 36288 loc_of_interest = 240.0, 12.49, 200000.0 + quantity_of_interest = 'KIND_ELECTRON_DENSITY' + interp_test_dlon = 0.1 + interp_test_dlat = 0.1 + interp_test_dvert = 50000.0 + interp_test_lonrange = 205.0, 226.0 + interp_test_latrange = 30.0, 47.0 + interp_test_vertrange = 200000.0, 300000.0 + interp_test_vertcoord = 'VERTISHEIGHT' + verbose = .false. / diff --git a/models/tiegcm/work/mkmf_advance_time b/models/tiegcm/work/mkmf_advance_time new file mode 100755 index 0000000000..3ff7a7c9e1 --- /dev/null +++ b/models/tiegcm/work/mkmf_advance_time @@ -0,0 +1,12 @@ +#!/bin/csh +# +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download + + ../../../mkmf/mkmf -p advance_time \ + -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_advance_time + +exit $status + diff --git a/models/tiegcm/work/mkmf_obs_sequence_tool b/models/tiegcm/work/mkmf_obs_sequence_tool new file mode 100755 index 0000000000..60964dba07 --- /dev/null +++ b/models/tiegcm/work/mkmf_obs_sequence_tool @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p obs_sequence_tool -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_obs_sequence_tool + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/models/tiegcm/work/path_names_advance_time b/models/tiegcm/work/path_names_advance_time new file mode 100644 index 0000000000..62fd921a9a --- /dev/null +++ b/models/tiegcm/work/path_names_advance_time @@ -0,0 +1,6 @@ +common/types_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +time_manager/advance_time.f90 +time_manager/time_manager_mod.f90 +utilities/parse_args_mod.f90 +utilities/utilities_mod.f90 diff --git a/models/tiegcm/work/path_names_filter b/models/tiegcm/work/path_names_filter index 185a0c06d9..270348d9a2 100644 --- a/models/tiegcm/work/path_names_filter +++ b/models/tiegcm/work/path_names_filter @@ -7,7 +7,7 @@ ensemble_manager/ensemble_manager_mod.f90 filter/filter.f90 location/threed_sphere/location_mod.f90 models/tiegcm/model_mod.f90 -mpi_utilities/null_mpi_utilities_mod.f90 +mpi_utilities/mpi_utilities_mod.f90 obs_def/obs_def_mod.f90 obs_kind/obs_kind_mod.f90 obs_model/obs_model_mod.f90 diff --git a/models/tiegcm/work/path_names_obs_sequence_tool b/models/tiegcm/work/path_names_obs_sequence_tool new file mode 100644 index 0000000000..32544d5306 --- /dev/null +++ b/models/tiegcm/work/path_names_obs_sequence_tool @@ -0,0 +1,13 @@ +assim_model/assim_model_mod.f90 +common/types_mod.f90 +cov_cutoff/cov_cutoff_mod.f90 +location/threed_sphere/location_mod.f90 +models/tiegcm/model_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +obs_def/obs_def_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_sequence/obs_sequence_mod.f90 +obs_sequence/obs_sequence_tool.f90 +random_seq/random_seq_mod.f90 +time_manager/time_manager_mod.f90 +utilities/utilities_mod.f90 diff --git a/models/tiegcm/work/path_names_wakeup_filter b/models/tiegcm/work/path_names_wakeup_filter index 8e8d38d02f..505dffc9c2 100644 --- a/models/tiegcm/work/path_names_wakeup_filter +++ b/models/tiegcm/work/path_names_wakeup_filter @@ -1,5 +1,5 @@ common/types_mod.f90 filter/wakeup_filter.f90 -mpi_utilities/null_mpi_utilities_mod.f90 +mpi_utilities/mpi_utilities_mod.f90 time_manager/time_manager_mod.f90 utilities/utilities_mod.f90 diff --git a/models/tiegcm/work/quickbuild.csh b/models/tiegcm/work/quickbuild.csh index 9e36dd9811..42a4e269b7 100755 --- a/models/tiegcm/work/quickbuild.csh +++ b/models/tiegcm/work/quickbuild.csh @@ -1,10 +1,8 @@ #!/bin/csh # -# DART software - Copyright 2004 - 2013 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at -# http://www.image.ucar.edu/DAReS/DART/DART_download -# -# DART $Id$ +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at +!# http://www.image.ucar.edu/DAReS/DART/DART_download # # Script to manage the compilation of all components for this model; # executes a known "perfect model" experiment using an existing @@ -23,6 +21,7 @@ \rm -f preprocess *.o *.mod \rm -f ../../../obs_def/obs_def_mod.f90 \rm -f ../../../obs_kind/obs_kind_mod.f90 +\rm -f using_mpi_for_* set MODEL = "tiegcm" @@ -61,7 +60,8 @@ foreach TARGET ( mkmf_* ) endsw end -\rm -f *.o *.mod +\rm -f *.o *.mod Makefile +\rm -f input.nml.*_default if ( $#argv == 1 && "$1" == "-mpi" ) then echo "Success: All single task DART programs compiled." @@ -110,19 +110,11 @@ echo "build number $n is mkmf_wakeup_filter" csh mkmf_wakeup_filter -mpi make || exit $n -\rm -f *.o *.mod +\rm -f *.o *.mod Makefile +\rm -f input.nml.*_default echo -echo 'time to run filter here:' -echo ' for lsf run "bsub < runme_filter"' -echo ' for pbs run "qsub runme_filter"' -echo ' for lam-mpi run "lamboot" once, then "runme_filter"' -echo ' for mpich run "mpd" once, then "runme_filter"' +echo 'filter must be run in an MPI environment.' exit 0 -# -# $URL$ -# $Revision$ -# $Date$ - diff --git a/mpi_utilities/mpi_utilities_mod.f90 b/mpi_utilities/mpi_utilities_mod.f90 index 2e9939b58a..4143198345 100644 --- a/mpi_utilities/mpi_utilities_mod.f90 +++ b/mpi_utilities/mpi_utilities_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module mpi_utilities_mod @@ -223,10 +221,9 @@ end function system sum_across_tasks, get_dart_mpi_comm ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'mpi_utilities_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical :: module_initialized = .false. @@ -2028,8 +2025,3 @@ subroutine exit_all(exit_code) end subroutine exit_all -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/mpi_utilities/null_mpi_utilities_mod.f90 b/mpi_utilities/null_mpi_utilities_mod.f90 index 6f674f4b91..0dffe28322 100644 --- a/mpi_utilities/null_mpi_utilities_mod.f90 +++ b/mpi_utilities/null_mpi_utilities_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module mpi_utilities_mod @@ -185,10 +183,9 @@ end function system sum_across_tasks ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'null_mpi_utilities_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical, save :: module_initialized = .false. @@ -794,8 +791,3 @@ subroutine exit_all(exit_code) end subroutine exit_all -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_def/DEFAULT_obs_def_mod.F90 b/obs_def/DEFAULT_obs_def_mod.F90 index 23b2c4608d..a4d4bb590c 100644 --- a/obs_def/DEFAULT_obs_def_mod.F90 +++ b/obs_def/DEFAULT_obs_def_mod.F90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ !---------------------------------------------------------------------- ! WARNING!! The file obs_def_mod.f90 is AUTOGENERATED by the @@ -104,10 +102,9 @@ module obs_def_mod assignment(=), get_obs_name ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'DEFAULT_obs_def_mod.F90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' type obs_def_type ! In revision, obs_kind module is responsible for taking care of @@ -679,8 +676,3 @@ end subroutine destroy_obs_def end module obs_def_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_def/obs_def_CO_Nadir_mod.f90 b/obs_def/obs_def_CO_Nadir_mod.f90 index e7167467af..442e679c8f 100644 --- a/obs_def/obs_def_CO_Nadir_mod.f90 +++ b/obs_def/obs_def_CO_Nadir_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ ! BEGIN DART PREPROCESS KIND LIST @@ -54,17 +52,15 @@ ! BEGIN DART PREPROCESS MODULE CODE + module obs_def_mopitt_mod -use typeSizes use types_mod, only : r8, MISSING_R8 use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG -use location_mod, only : location_type, set_location, get_location, VERTISPRESSURE, & - VERTISLEVEL, VERTISSURFACE - +use location_mod, only : location_type, set_location, get_location, & + VERTISPRESSURE, VERTISLEVEL, VERTISSURFACE use assim_model_mod, only : interpolate -use obs_kind_mod, only : KIND_CO, KIND_PRESSURE, KIND_SURFACE_PRESSURE - +use obs_kind_mod, only : KIND_CO, KIND_PRESSURE, KIND_SURFACE_PRESSURE implicit none @@ -79,32 +75,32 @@ module obs_def_mopitt_mod ! KDR replace 10 with mopitt_dim? ! real(r8), dimension(max_mopitt_co_obs,10) :: avg_kernel real(r8), dimension(max_mopitt_co_obs,mopitt_dim) :: avg_kernel -real(r8), dimension(max_mopitt_co_obs) :: mopitt_prior -real(r8) :: mopitt_pressure(mopitt_dim) =(/ & - 95000.,90000.,80000.,70000.,60000.,50000.,40000.,30000.,20000.,10000. /) -real(r8), dimension(max_mopitt_co_obs) :: mopitt_psurf -integer, dimension(max_mopitt_co_obs) :: mopitt_nlevels + +real(r8) :: mopitt_pressure(mopitt_dim) = & + (/ 95000.,90000.,80000.,70000.,60000.,50000.,40000.,30000.,20000.,10000. /) +real(r8), dimension(max_mopitt_co_obs) :: mopitt_prior +real(r8), dimension(max_mopitt_co_obs) :: mopitt_psurf +integer, dimension(max_mopitt_co_obs) :: mopitt_nlevels ! For now, read in all info on first read call, write all info on first write call logical :: already_read = .false., already_written = .false. ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_def_NADIR_CO_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical, save :: module_initialized = .false. integer :: counts1 = 0 contains -!---------------------------------------------------------------------- - subroutine initialize_module -!---------------------------------------------------------------------------- -! subroutine initialize_module +!------------------------------------------------------------------------------- +!> + +subroutine initialize_module call register_module(source, revision, revdate) module_initialized = .true. @@ -112,21 +108,21 @@ subroutine initialize_module end subroutine initialize_module +!------------------------------------------------------------------------------- +!> - subroutine read_mopitt_co(key, ifile, fform) -!---------------------------------------------------------------------- -!subroutine read_mopitt_co(key, ifile, fform) +subroutine read_mopitt_co(key, ifile, fform) -integer, intent(out) :: key -integer, intent(in) :: ifile -character(len=*), intent(in), optional :: fform -character(len=32) :: fileformat +integer, intent(out) :: key +integer, intent(in) :: ifile +character(len=*), intent(in), optional :: fform +character(len=32) :: fileformat -integer :: mopitt_nlevels_1 -real(r8) :: mopitt_prior_1 -real(r8) :: mopitt_psurf_1 -real(r8), dimension(mopitt_dim) :: avg_kernels_1 -integer :: keyin +integer :: mopitt_nlevels_1 +real(r8) :: mopitt_prior_1 +real(r8) :: mopitt_psurf_1 +real(r8) :: avg_kernels_1(mopitt_dim) +integer :: keyin if ( .not. module_initialized ) call initialize_module @@ -143,16 +139,16 @@ subroutine read_mopitt_co(key, ifile, fform) CASE ("unf", "UNF", "unformatted", "UNFORMATTED") mopitt_nlevels_1 = read_mopitt_nlevels(ifile, fileformat) - mopitt_prior_1 = read_mopitt_prior(ifile, fileformat) - mopitt_psurf_1 = read_mopitt_psurf(ifile, fileformat) - avg_kernels_1(1:mopitt_nlevels_1) = read_mopitt_avg_kernels(ifile, mopitt_nlevels_1, fileformat) + mopitt_prior_1 = read_mopitt_prior( ifile, fileformat) + mopitt_psurf_1 = read_mopitt_psurf( ifile, fileformat) + avg_kernels_1(1:mopitt_nlevels_1) = read_mopitt_avg_kernels(ifile, mopitt_nlevels_1, fileformat) read(ifile) keyin CASE DEFAULT mopitt_nlevels_1 = read_mopitt_nlevels(ifile, fileformat) - mopitt_prior_1 = read_mopitt_prior(ifile, fileformat) - mopitt_psurf_1 = read_mopitt_psurf(ifile, fileformat) - avg_kernels_1(1:mopitt_nlevels_1) = read_mopitt_avg_kernels(ifile, mopitt_nlevels_1, fileformat) + mopitt_prior_1 = read_mopitt_prior( ifile, fileformat) + mopitt_psurf_1 = read_mopitt_psurf( ifile, fileformat) + avg_kernels_1(1:mopitt_nlevels_1) = read_mopitt_avg_kernels(ifile, mopitt_nlevels_1, fileformat) read(ifile, *) keyin END SELECT @@ -164,16 +160,17 @@ subroutine read_mopitt_co(key, ifile, fform) end subroutine read_mopitt_co - subroutine write_mopitt_co(key, ifile, fform) -!---------------------------------------------------------------------- -!subroutine write_mopitt_co(key, ifile, fform) +!------------------------------------------------------------------------------- +!> + +subroutine write_mopitt_co(key, ifile, fform) -integer, intent(in) :: key -integer, intent(in) :: ifile -character(len=*), intent(in), optional :: fform +integer, intent(in) :: key +integer, intent(in) :: ifile +character(len=*), intent(in), optional :: fform -character(len=32) :: fileformat -real(r8), dimension(mopitt_dim) :: avg_kernels_temp +character(len=32) :: fileformat +real(r8) :: avg_kernels_temp(mopitt_dim) if ( .not. module_initialized ) call initialize_module @@ -206,12 +203,11 @@ subroutine write_mopitt_co(key, ifile, fform) end subroutine write_mopitt_co - subroutine interactive_mopitt_co(key) -!---------------------------------------------------------------------- -!subroutine interactive_mopitt_co(key) -! -! Initializes the specialized part of a MOPITT observation -! Passes back up the key for this one +!------------------------------------------------------------------------------- +!> Initializes the specialized part of a MOPITT observation +!> Passes back up the key for this one + +subroutine interactive_mopitt_co(key) integer, intent(out) :: key @@ -235,33 +231,36 @@ subroutine interactive_mopitt_co(key) ! Otherwise, prompt for input for the three required beasts write(*, *) 'Creating an interactive_mopitt_co observation' write(*, *) 'Input the MOPITT Prior ' -read(*, *) mopitt_prior +read(*, *) mopitt_prior(key) write(*, *) 'Input MOPITT Surface Pressure ' -read(*, *) mopitt_psurf(num_mopitt_co_obs) +read(*, *) mopitt_psurf(key) write(*, *) 'Input the 10 Averaging Kernel Weights ' -read(*, *) avg_kernel(num_mopitt_co_obs,:) +read(*, *) avg_kernel(key,:) end subroutine interactive_mopitt_co - subroutine get_expected_iasi_co(state, location, key, val, istatus) -!--------------------------------------------------------------------- -real(r8), intent(in) :: state(:) -type(location_type), intent(in) :: location -integer, intent(in) :: key -real(r8), intent(out) :: val -integer, intent(out) :: istatus +!------------------------------------------------------------------------------- +!> + +subroutine get_expected_iasi_co(state, location, key, val, istatus) + +real(r8), intent(in) :: state(:) +type(location_type), intent(in) :: location +integer, intent(in) :: key +real(r8), intent(out) :: val +integer, intent(out) :: istatus + integer :: i,j integer :: num_levs, lev -type(location_type) :: loc1,loc2,loc3,loc3p,loc3m,locS -real(r8) :: mloc(3), mloc1(3), mloc2(3) -real(r8) :: obs_val, pres, surf_pres, obs_val_int +type(location_type) :: loc3,locS +real(r8) :: mloc(3) +real(r8) :: obs_val, obs_val_int real(r8) :: top_pres, bot_pres, coef, mop_layer_wght -real(r8) :: i_top_pres, i_bot_pres, i_pres +real(r8) :: i_top_pres, i_bot_pres real(r8) :: p_col(max_model_levs) real(r8) :: mopitt_pres_local(mopitt_dim) integer :: nlevels, start_i, end_i -integer, allocatable :: dim_sizes(:) if ( .not. module_initialized ) call initialize_module val = 0.0_r8 @@ -285,15 +284,17 @@ subroutine get_expected_iasi_co(state, location, key, val, istatus) ! Find the number of model levels and the pressures on them. istatus = 0 p_col = MISSING_R8 -CAM_levs: do lev = 1,100 +lev = 1 +model_levels: do locS = set_location(mloc(1),mloc(2),real(lev,r8),VERTISLEVEL) call interpolate(state, locS, KIND_PRESSURE, p_col(lev), istatus) if (istatus /= 0) then p_col(lev) = MISSING_R8 num_levs = lev - 1 - exit CAM_levs + exit model_levels endif -enddo CAM_levs + lev = lev + 1 +enddo model_levels ! KDR: see comments in the same place in get_expected_mopitt_co. @@ -310,7 +311,7 @@ subroutine get_expected_iasi_co(state, location, key, val, istatus) obs_val=0.0_r8 bot_pres=mopitt_pres_local(i) - if (i == 10) then + if (i == mopitt_dim) then top_pres=mopitt_pres_local(i)/2.0_r8 else top_pres=mopitt_pres_local(i+1) @@ -367,29 +368,30 @@ subroutine get_expected_iasi_co(state, location, key, val, istatus) istatus = 7 endif - end subroutine get_expected_iasi_co +end subroutine get_expected_iasi_co - subroutine get_expected_mopitt_co(state, location, key, val, istatus) -!---------------------------------------------------------------------- -real(r8), intent(in) :: state(:) -type(location_type), intent(in) :: location -integer, intent(in) :: key -real(r8), intent(out) :: val -integer, intent(out) :: istatus -integer :: i,j -type(location_type) :: loc1,loc2,loc3,loc3p,loc3m,locS -real(r8) :: mloc(3), mloc1(3), mloc2(3) -real(r8) :: obs_val, pres, obs_val_int +!------------------------------------------------------------------------------- +!> +subroutine get_expected_mopitt_co(state, location, key, val, istatus) +real(r8), intent(in) :: state(:) +type(location_type), intent(in) :: location +integer, intent(in) :: key +real(r8), intent(out) :: val +integer, intent(out) :: istatus + +integer :: i,j +type(location_type) :: loc3,locS +real(r8) :: mloc(3) +real(r8) :: obs_val, obs_val_int integer :: nlevels, start_i, end_i real(r8) :: top_pres, bot_pres, coef, mop_layer_wght -real(r8) :: i_top_pres, i_bot_pres, i_pres +real(r8) :: i_top_pres, i_bot_pres integer :: num_levs, lev real(r8) :: p_col(max_model_levs) real(r8) :: mopitt_pres_local(mopitt_dim) -integer, allocatable :: dim_sizes(:) if ( .not. module_initialized ) call initialize_module mloc = get_location(location) @@ -427,15 +429,18 @@ subroutine get_expected_mopitt_co(state, location, key, val, istatus) ! Find the number of model levels and the pressures on them. istatus = 0 p_col = MISSING_R8 -CAM_levs: do lev = 1,100 !!FIND A WAY TO GET THE MODEL LEVELS +lev = 1 +model_levels: do locS = set_location(mloc(1),mloc(2),real(lev,r8),VERTISLEVEL) call interpolate(state, locS, KIND_PRESSURE, p_col(lev), istatus) if (istatus /= 0) then p_col(lev) = MISSING_R8 num_levs = lev - 1 - exit CAM_levs + exit model_levels endif -enddo CAM_levs + lev = lev + 1 +enddo model_levels + !Barre: here p_col is the pressure levels at the grid points, we will need to have in !the future the pressure values at the mid-points (need to create a new function !plevs_cam in model_mod using the the mid-levels hybrid coefs) @@ -544,15 +549,17 @@ subroutine get_expected_mopitt_co(state, location, key, val, istatus) end subroutine get_expected_mopitt_co - subroutine set_obs_def_mopitt_co(key, co_avgker, co_prior, co_psurf, co_nlevels) -!---------------------------------------------------------------------- -! Allows passing of obs_def special information +!------------------------------------------------------------------------------- +!> Allows passing of obs_def special information + +subroutine set_obs_def_mopitt_co(key, co_avgker, co_prior, co_psurf, co_nlevels) + +integer, intent(in) :: key, co_nlevels +real(r8), intent(in) :: co_avgker(10) +real(r8), intent(in) :: co_prior +real(r8), intent(in) :: co_psurf -integer, intent(in) :: key, co_nlevels -real(r8),dimension(10), intent(in) :: co_avgker -real(r8), intent(in) :: co_prior -real(r8), intent(in) :: co_psurf -character(len=129) :: msgstring +character(len=129) :: msgstring if ( .not. module_initialized ) call initialize_module @@ -564,23 +571,23 @@ subroutine set_obs_def_mopitt_co(key, co_avgker, co_prior, co_psurf, co_nlevels) call error_handler(E_ERR,'set_obs_def_mopitt_co',msgstring,source,revision,revdate) endif -avg_kernel(key,:) = co_avgker(:) -mopitt_prior(key) = co_prior -mopitt_psurf(key) = co_psurf -mopitt_nlevels(key) = co_nlevels - +avg_kernel(key,:) = co_avgker(:) +mopitt_prior(key) = co_prior +mopitt_psurf(key) = co_psurf +mopitt_nlevels(key) = co_nlevels end subroutine set_obs_def_mopitt_co +!------------------------------------------------------------------------------- +!> + function read_mopitt_prior(ifile, fform) integer, intent(in) :: ifile +character(len=*), optional, intent(in) :: fform real(r8) :: read_mopitt_prior -character(len=*), intent(in), optional :: fform -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat if ( .not. module_initialized ) call initialize_module @@ -597,14 +604,16 @@ function read_mopitt_prior(ifile, fform) end function read_mopitt_prior + +!------------------------------------------------------------------------------- +!> + function read_mopitt_nlevels(ifile, fform) integer, intent(in) :: ifile -integer :: read_mopitt_nlevels -character(len=*), intent(in), optional :: fform +character(len=*), optional, intent(in) :: fform +integer :: read_mopitt_nlevels -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat if ( .not. module_initialized ) call initialize_module @@ -622,15 +631,15 @@ function read_mopitt_nlevels(ifile, fform) end function read_mopitt_nlevels +!------------------------------------------------------------------------------- +!> subroutine write_mopitt_prior(ifile, mopitt_prior_temp, fform) -integer, intent(in) :: ifile -real(r8), intent(in) :: mopitt_prior_temp -character(len=32), intent(in) :: fform +integer, intent(in) :: ifile +real(r8), intent(in) :: mopitt_prior_temp +character(len=*), intent(in) :: fform -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat if ( .not. module_initialized ) call initialize_module @@ -646,14 +655,16 @@ subroutine write_mopitt_prior(ifile, mopitt_prior_temp, fform) end subroutine write_mopitt_prior + +!------------------------------------------------------------------------------- +!> + subroutine write_mopitt_nlevels(ifile, mopitt_nlevels_temp, fform) -integer, intent(in) :: ifile -integer, intent(in) :: mopitt_nlevels_temp -character(len=32), intent(in) :: fform +integer, intent(in) :: ifile +integer, intent(in) :: mopitt_nlevels_temp +character(len=*), intent(in) :: fform -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat if ( .not. module_initialized ) call initialize_module @@ -670,15 +681,15 @@ subroutine write_mopitt_nlevels(ifile, mopitt_nlevels_temp, fform) end subroutine write_mopitt_nlevels +!------------------------------------------------------------------------------- +!> function read_mopitt_psurf(ifile, fform) integer, intent(in) :: ifile +character(len=*), optional, intent(in) :: fform real(r8) :: read_mopitt_psurf -character(len=*), intent(in), optional :: fform -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat if ( .not. module_initialized ) call initialize_module @@ -695,14 +706,16 @@ function read_mopitt_psurf(ifile, fform) end function read_mopitt_psurf + +!------------------------------------------------------------------------------- +!> + subroutine write_mopitt_psurf(ifile, mopitt_psurf_temp, fform) -integer, intent(in) :: ifile -real(r8), intent(in) :: mopitt_psurf_temp -character(len=32), intent(in) :: fform +integer, intent(in) :: ifile +real(r8), intent(in) :: mopitt_psurf_temp +character(len=*), intent(in) :: fform -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat if ( .not. module_initialized ) call initialize_module @@ -718,14 +731,16 @@ subroutine write_mopitt_psurf(ifile, mopitt_psurf_temp, fform) end subroutine write_mopitt_psurf + +!------------------------------------------------------------------------------- +!> + function read_mopitt_avg_kernels(ifile, nlevels, fform) integer, intent(in) :: ifile, nlevels -real(r8), dimension(10) :: read_mopitt_avg_kernels -character(len=*), intent(in), optional :: fform +character(len=*), optional, intent(in) :: fform +real(r8) :: read_mopitt_avg_kernels(10) -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat read_mopitt_avg_kernels(:) = 0.0_r8 @@ -744,14 +759,16 @@ function read_mopitt_avg_kernels(ifile, nlevels, fform) end function read_mopitt_avg_kernels + +!------------------------------------------------------------------------------- +!> + subroutine write_mopitt_avg_kernels(ifile, avg_kernels_temp, nlevels_temp, fform) -integer, intent(in) :: ifile, nlevels_temp -real(r8), dimension(10), intent(in) :: avg_kernels_temp -character(len=32), intent(in) :: fform +integer, intent(in) :: ifile, nlevels_temp +real(r8), intent(in) :: avg_kernels_temp(10) +character(len=*), intent(in) :: fform -character(len=5) :: header -character(len=129) :: errstring character(len=32) :: fileformat if ( .not. module_initialized ) call initialize_module @@ -767,14 +784,8 @@ subroutine write_mopitt_avg_kernels(ifile, avg_kernels_temp, nlevels_temp, fform end subroutine write_mopitt_avg_kernels - +!---------------------------------------------------------------------- end module obs_def_mopitt_mod -! END DART PREPROCESS MODULE CODE - -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ +! END DART PREPROCESS MODULE CODE diff --git a/obs_def/obs_def_GOLD_mod.f90 b/obs_def/obs_def_GOLD_mod.f90 new file mode 100644 index 0000000000..97abc4f40a --- /dev/null +++ b/obs_def/obs_def_GOLD_mod.f90 @@ -0,0 +1,273 @@ +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download + +! This module supports the observation types from the GOLD instruments. +! https://gold.cs.ucf.edu/data/ + +! BEGIN DART PREPROCESS KIND LIST +! GOLD_TEMPERATURE, KIND_TEMPERATURE, COMMON_CODE +! GOLD_NEMAX, KIND_NEMAX_DISK +! GOLD_ON2COLUMN, KIND_ON2_DISK +! END DART PREPROCESS KIND LIST + +! BEGIN DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE +! use obs_def_GOLD_mod, only : get_expected_nemax +! use obs_def_GOLD_mod, only : get_expected_on2 +! END DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE + +! BEGIN DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF +! case(GOLD_NEMAX) +! call get_expected_nemax(state, location, obs_val, istatus) +! case(GOLD_ON2COLUMN) +! call get_expected_on2(state, location, obs_val, istatus) +! END DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF + +! BEGIN DART PREPROCESS READ_OBS_DEF +! case(GOLD_NEMAX) +! continue +! case(GOLD_ON2COLUMN) +! continue +! END DART PREPROCESS READ_OBS_DEF + +! BEGIN DART PREPROCESS WRITE_OBS_DEF +! case(GOLD_NEMAX) +! continue +! case(GOLD_ON2COLUMN) +! continue +! END DART PREPROCESS WRITE_OBS_DEF + +! BEGIN DART PREPROCESS INTERACTIVE_OBS_DEF +! case(GOLD_NEMAX) +! continue +! case(GOLD_ON2COLUMN) +! continue +! END DART PREPROCESS INTERACTIVE_OBS_DEF + +! BEGIN DART PREPROCESS MODULE CODE +module obs_def_GOLD_mod + +use types_mod, only : r8, MISSING_R8 +use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG +use location_mod, only : location_type, get_location, set_location, & + VERTISHEIGHT, VERTISLEVEL, VERTISUNDEF +use assim_model_mod, only : interpolate +use obs_kind_mod, only : KIND_NEMAX_DISK, & + KIND_ON2_DISK, & + KIND_TEMPERATURE, & + KIND_ELECTRON_DENSITY, & + KIND_GEOMETRIC_HEIGHT, & + KIND_ATOMIC_OXYGEN_MIXING_RATIO, & + KIND_MOLEC_OXYGEN_MIXING_RATIO, & + KIND_MOLEC_NITROGEN_MIXING_RATIO, & + KIND_PRESSURE, & + KIND_TEMPERATURE + +implicit none +private +public :: get_expected_nemax, & + get_expected_on2 + +! version controlled file description for error handling, do not edit +character(len=*), parameter :: source = 'obs_def_GOLD_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' + +real(r8), PARAMETER :: universal_gas_constant = 8314.0_r8 ! [J/K/kmol] +real(r8), PARAMETER :: boltzmann_constant = 1.38064852E-23_r8 ! [J/K] +logical, save :: module_initialized = .false. + +contains + +!----------------------------------------------------------------------------- + +subroutine initialize_module + + call register_module(source, revision, revdate) + module_initialized = .true. + +end subroutine initialize_module + +!----------------------------------------------------------------------------- +!> Given DART state vector and a location, +!> retrieve ionospheric maximum electron density in column [/m3] +!> The istatus variable should be returned as 0 unless there is a problem + +subroutine get_expected_nemax(x, location, obs_val, istatus) + +real(r8), intent(in) :: x(:) +type(location_type), intent(in) :: location +real(r8), intent(out) :: obs_val +integer, intent(out) :: istatus + +! 'istatus' is the return code. 0 is success; any positive value signals an +! error (different values can be used to indicate different error types). +! Negative istatus values are reserved for internal use only by DART. + +integer :: nAlts, iAlt +real(r8), allocatable :: ALT(:), IDensityS_ie(:) +real(r8) :: loc_vals(3) +real(r8) :: nemax +type(location_type) :: probe + +if ( .not. module_initialized ) call initialize_module + +istatus = 36 !initially bad return code +obs_val = MISSING_R8 + +! something larger than the expected number of vert levels in the model +! TIE-GCM should have either 29 or 57 vertical levels +allocate(ALT(500), IDensityS_ie(500)) + +ALT = 0.0_r8 +IDensityS_ie = 0.0_r8 + +loc_vals = get_location(location) + +nAlts = 0 +LEVELS: do iAlt=1, size(ALT)+1 + ! loop over levels. if we get to one more than the allocated array size, + ! this model must have more levels than we expected. increase array sizes, + ! recompile, and try again. + if (iAlt > size(ALT)) then + call error_handler(E_ERR, 'get_expected_nemax', 'more than 500 levels in model', & + source, revision, revdate, & + text2='increase ALT, IDensityS_ie array sizes in code and recompile') + endif + ! At each altitude interpolate the 2D IDensityS_ie to the lon-lat where data + ! point is located after this loop we will get a column centered at data + ! point's lon-lat and at all model altitudes + probe = set_location(loc_vals(1), loc_vals(2), real(iAlt, r8), VERTISLEVEL) !probe is where we have data + + call interpolate(x, probe, KIND_ELECTRON_DENSITY, IDensityS_ie(iAlt), istatus) + if (istatus /= 0) exit LEVELS + + nAlts = nAlts+1 +enddo LEVELS + +if (nAlts == 0) return + +! istatus is guaranteed to have a failure status (the only way to exit the +! "LEVELS" loop). Since we got this far, we need to reset the status to +! indicate a successful forward operator. + +istatus = 0 +nemax = maxval(IDensityS_ie(1:nAlts)) +obs_val = nemax + +end subroutine get_expected_nemax + + +!----------------------------------------------------------------------------- +!> Given DART state vector and a location, compute column abundance of O +!> relative to N2 down to N2 reference depth of 1e17 [/cm2] +!> +!> The istatus variable should be returned as 0 unless there is a problem + +subroutine get_expected_on2(x, location, obs_val, istatus) + +real(r8), intent(in) :: x(:) +type(location_type), intent(in) :: location +real(r8), intent(out) :: obs_val +integer, intent(out) :: istatus + +! 'istatus' is the return code. 0 is success; any positive value signals an +! error (different values can be used to indicate different error types). +! Negative istatus values are reserved for internal use only by DART. + +integer :: nAlts, iAlt +real(r8), allocatable :: ALT(:) +real(r8) :: loc_vals(3) +real(r8) :: o1_ratio, o2_ratio, press, temp, nd +real(r8) :: n2_ratio +real(r8), allocatable :: o1_number(:), n2_number(:) +real(r8) :: o1_sum, n2_sum +real(r8) :: o1_inc, n2_inc +type(location_type) :: probe + +real(r8), PARAMETER :: n2_sum_ref = 1.0E21 + +if ( .not. module_initialized ) call initialize_module + +istatus = 36 !initially bad return code +obs_val = MISSING_R8 + +! something larger than the expected number of vert levels in the model +! TIE-GCM should have either 29 or 57 vertical levels +allocate(ALT(500), o1_number(500), n2_number(500)) +ALT = 0.0_r8 +o1_number = 0.0_r8 +n2_number = 0.0_r8 + +loc_vals = get_location(location) + +nAlts = 0 +LEVELS: do iAlt=1, size(ALT)+1 + ! loop over levels. if we get to one more than the allocated array size, + ! this model must have more levels than we expected. increase array sizes, + ! recompile, and try again. + if (iAlt > size(ALT)) then + call error_handler(E_ERR, 'get_expected_on2', 'more than 500 levels in model', & + source, revision, revdate, & + text2='increase ALT, IDensityS_ie array sizes in code and recompile') + endif + ! At each altitude interpolate the 2D IDensityS_ie to the lon-lat where data + ! point is located after this loop we will get a column centered at data + ! point's lon-lat and at all model altitudes + probe = set_location(loc_vals(1), loc_vals(2), real(iAlt, r8), VERTISLEVEL) !probe is where we have data + call interpolate(x, probe, KIND_ATOMIC_OXYGEN_MIXING_RATIO, o1_ratio, istatus) + if (istatus /= 0) exit LEVELS + !call interpolate(x, probe, KIND_MOLEC_OXYGEN_MIXING_RATIO, o2_ratio, istatus) + !if (istatus /= 0) exit LEVELS + call interpolate(x, probe, KIND_MOLEC_NITROGEN_MIXING_RATIO, n2_ratio, istatus) + if (istatus /= 0) exit LEVELS + call interpolate(x, probe, KIND_GEOMETRIC_HEIGHT, ALT(iAlt), istatus) + if (istatus /= 0) exit LEVELS + call interpolate(x, probe, KIND_PRESSURE, press, istatus) + if (istatus /= 0) exit LEVELS + call interpolate(x, probe, KIND_TEMPERATURE, temp, istatus) + if (istatus /= 0) exit LEVELS + nd = press / (boltzmann_constant * temp) + o1_number(iAlt) = o1_ratio * nd + !n2_number(iAlt) = (1 - o1_ratio - o2_ratio) * nd + n2_number(iAlt) = n2_ratio * nd + nAlts = nAlts+1 +enddo LEVELS + +if (nAlts == 0) then + istatus = 36 + return +endif + +n2_sum = 0.0_r8 +o1_sum = 0.0_r8 + +TRAPZ: do iAlt = nAlts-1,1,-1 !approximate the integral over the altitude as a sum of trapezoids + !area of a trapezoid: A = (h2-h1) * (f2+f1)/2 + n2_inc = ( ALT(iAlt+1)-ALT(iAlt) ) * ( n2_number(iAlt+1)+n2_number(iAlt) ) /2.0_r8 + o1_inc = ( ALT(iAlt+1)-ALT(iAlt) ) * ( o1_number(iAlt+1)+o1_number(iAlt) ) /2.0_r8 + if ((n2_sum + n2_inc) .lt. n2_sum_ref) then + n2_sum = n2_sum + n2_inc + o1_sum = o1_sum + o1_inc + else + o1_sum = o1_sum + (o1_inc * (n2_sum_ref - n2_sum) / n2_inc) + n2_sum = n2_sum_ref + exit TRAPZ + end if +enddo TRAPZ + +! TJH is it possible that n2_sum (or n2_inc) is zero ... +istatus = 0 + +if (n2_sum .gt. 0.0_r8) then + obs_val = o1_sum / n2_sum +else + obs_val = MISSING_R8 +endif + +end subroutine get_expected_on2 + + +end module obs_def_GOLD_mod +! END DART PREPROCESS MODULE CODE + diff --git a/obs_def/obs_def_gps_mod.f90 b/obs_def/obs_def_gps_mod.f90 index f5e2b03a7d..5a0efa7819 100644 --- a/obs_def/obs_def_gps_mod.f90 +++ b/obs_def/obs_def_gps_mod.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ ! Note: This version has a namelist item for the max number of ! gps observations that can be read in, but it is currently commented out. @@ -12,11 +10,11 @@ ! files (e.g. for the obs_diag program) might be a larger number than 100K. ! BEGIN DART PREPROCESS KIND LIST -! TEMPERATURE, KIND_TEMPERATURE, COMMON_CODE -! SPECIFIC_HUMIDITY, KIND_SPECIFIC_HUMIDITY, COMMON_CODE -! PRESSURE, KIND_PRESSURE, COMMON_CODE -! GPSRO_REFRACTIVITY, KIND_GPSRO -! COSMIC_ELECTRON_DENSITY, KIND_ELECTRON_DENSITY, COMMON_CODE +! TEMPERATURE, KIND_TEMPERATURE, COMMON_CODE +! SPECIFIC_HUMIDITY, KIND_SPECIFIC_HUMIDITY, COMMON_CODE +! PRESSURE, KIND_PRESSURE, COMMON_CODE +! GPSRO_REFRACTIVITY, KIND_GPSRO +! COSMIC_ELECTRON_DENSITY, KIND_ELECTRON_DENSITY, COMMON_CODE ! END DART PREPROCESS KIND LIST @@ -73,10 +71,9 @@ module obs_def_gps_mod get_expected_gpsro_ref, interactive_gpsro_ref ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_def_gps_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical, save :: module_initialized = .false. @@ -679,8 +676,3 @@ end module obs_def_gps_mod ! END DART PREPROCESS MODULE CODE -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_def/obs_def_upper_atm_mod.f90 b/obs_def/obs_def_upper_atm_mod.f90 index 4d999d994f..c4e981dc5c 100644 --- a/obs_def/obs_def_upper_atm_mod.f90 +++ b/obs_def/obs_def_upper_atm_mod.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ ! Fortran has a limit of 32 characters for variable names. Hence, ! each column can be at most 32 characters wide. @@ -44,40 +42,53 @@ ! SAT_VELOCITY_VERTICAL_N4S, KIND_VELOCITY_VERTICAL_N4S, COMMON_CODE ! SAT_VELOCITY_VERTICAL_NO, KIND_VELOCITY_VERTICAL_NO, COMMON_CODE ! SAT_F107, KIND_1D_PARAMETER, COMMON_CODE -! SAT_RHO, KIND_DENSITY ! GPS_PROFILE, KIND_ELECTRON_DENSITY, COMMON_CODE +! GPS_VTEC_EXTRAP, KIND_VERTICAL_TEC, COMMON_CODE ! COSMIC_ELECTRON_DENSITY, KIND_ELECTRON_DENSITY, COMMON_CODE -! GND_GPS_VTEC, KIND_GND_GPS_VTEC +! SAT_RHO, KIND_DENSITY ! CHAMP_DENSITY, KIND_DENSITY -! MIDAS_TEC, KIND_VERTICAL_TEC +! GND_GPS_VTEC, KIND_GND_GPS_VTEC +! GROUND_SLANT_TEC, KIND_SLANT_TEC ! SSUSI_O_N2_RATIO, KIND_O_N2_COLUMN_DENSITY_RATIO -! GPS_VTEC_EXTRAP, KIND_VERTICAL_TEC, COMMON_CODE +! MIDAS_TEC, KIND_VERTICAL_TEC ! END DART PREPROCESS KIND LIST +! NOTE: GPS_VTEC_EXTRAP can come from the COMMON_CODE because the tiegcm model_mod.f90 +! creates a KIND_VERTICAL_TEC on-demand as it reads in the model state. Since not +! all models can be expected to do this, there is a stub routine +! get_expected_gps_vtec_extrap() that will need to be written. At that time, the +! DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF block will need to be extended and the +! COMMON_CODE removed from the table above. TJH 17 May 2016 + ! BEGIN DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE -! use obs_def_upper_atm_mod, only : get_expected_upper_atm_density -! use obs_def_upper_atm_mod, only : get_expected_gnd_gps_vtec -! use obs_def_upper_atm_mod, only : get_expected_vtec -! use obs_def_upper_atm_mod, only : get_expected_O_N2_ratio +! use obs_def_upper_atm_mod, only : get_expected_upper_atm_density, & +! get_expected_gnd_gps_vtec, & +! get_expected_gps_vtec_extrap, & +! get_expected_O_N2_ratio, & +! get_expected_slant_tec, & +! read_slant_tec_metadata, & +! write_slant_tec_metadata, & +! interactive_slant_tec_metadata ! END DART PREPROCESS USE OF SPECIAL OBS_DEF MODULE +! NOTE: +! CHAMP_DENSITY can be created with observations/CHAMP/CHAMP_density_text_to_obs + ! BEGIN DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF -! case(SAT_RHO) +! case(SAT_RHO, CHAMP_DENSITY) ! call get_expected_upper_atm_density(state, location, obs_val, istatus) -! case(CHAMP_DENSITY) -! call get_expected_upper_atm_density(state, location, obs_val, istatus) -! case(MIDAS_TEC) -! call get_expected_vtec(state, location, obs_val, istatus) ! case(GND_GPS_VTEC) ! call get_expected_gnd_gps_vtec(state, location, obs_val, istatus) ! case(SSUSI_O_N2_RATIO) ! call get_expected_O_N2_ratio(state, location, obs_val, istatus) +! case(GROUND_SLANT_TEC) +! call get_expected_slant_tec(state, location, obs_def%key, obs_val, istatus) ! END DART PREPROCESS GET_EXPECTED_OBS_FROM_DEF ! BEGIN DART PREPROCESS READ_OBS_DEF ! case(SAT_RHO) ! continue -! case(CHAMP_DENSITY) +! case(CHAMP_DENSITY) ! continue ! case(MIDAS_TEC) ! continue @@ -85,6 +96,8 @@ ! continue ! case(SSUSI_O_N2_RATIO) ! continue +! case(GROUND_SLANT_TEC) +! call read_slant_tec_metadata(obs_def%key, key, ifile, fform) ! END DART PREPROCESS READ_OBS_DEF ! BEGIN DART PREPROCESS WRITE_OBS_DEF @@ -98,6 +111,8 @@ ! continue ! case(SSUSI_O_N2_RATIO) ! continue +! case(GROUND_SLANT_TEC) +! call write_slant_tec_metadata(obs_def%key, ifile, fform) ! END DART PREPROCESS WRITE_OBS_DEF ! BEGIN DART PREPROCESS INTERACTIVE_OBS_DEF @@ -111,15 +126,19 @@ ! continue ! case(SSUSI_O_N2_RATIO) ! continue +! case(GROUND_SLANT_TEC) +! call interactive_slant_tec_metadata(obs_def%key) ! END DART PREPROCESS INTERACTIVE_OBS_DEF ! BEGIN DART PREPROCESS MODULE CODE module obs_def_upper_atm_mod use types_mod, only : r8, MISSING_R8 -use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG +use utilities_mod, only : register_module, error_handler, E_ERR, E_MSG, & + ascii_file_format use location_mod, only : location_type, get_location, set_location, & - VERTISHEIGHT, VERTISLEVEL + VERTISHEIGHT, VERTISLEVEL, interactive_location, & + read_location, write_location use assim_model_mod, only : interpolate use obs_kind_mod, only : KIND_ATOMIC_OXYGEN_MIXING_RATIO, & KIND_MOLEC_OXYGEN_MIXING_RATIO, & @@ -128,7 +147,6 @@ module obs_def_upper_atm_mod KIND_DENSITY, & KIND_DENSITY_ION_E, & KIND_GND_GPS_VTEC, & - KIND_GEOPOTENTIAL_HEIGHT, & KIND_GEOMETRIC_HEIGHT, & KIND_O_N2_COLUMN_DENSITY_RATIO @@ -136,42 +154,73 @@ module obs_def_upper_atm_mod private public :: get_expected_upper_atm_density, & get_expected_gnd_gps_vtec, & - get_expected_vtec, & - get_expected_O_N2_ratio + get_expected_gps_vtec_extrap, & + get_expected_O_N2_ratio, & + get_expected_slant_tec, & + read_slant_tec_metadata, & + write_slant_tec_metadata, & + interactive_slant_tec_metadata ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_def_upper_atm_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical, save :: module_initialized = .false. -real(r8), PARAMETER :: N2_molar_mass = 28.0_r8 -real(r8), PARAMETER :: O_molar_mass = 16.0_r8 -real(r8), PARAMETER :: O2_molar_mass = 32.0_r8 +! Derived type for slant tec observatons. +! Contains auxiliary information stored with each obs of this type. +! The information is needed to compute the forward operator. + +type slant_tec_type + private + type(location_type) :: receiver_location + type(location_type) :: transmitter_location +end type slant_tec_type +type(slant_tec_type), allocatable :: slant_tec_metadata(:) + +integer :: MAX_slant_tec_key = 1000 +integer :: slant_tec_counter = 0 ! Cumulative index into slant_tec_metadata array + +integer, PARAMETER :: labellength = 5 +character(len=labellength) :: RECEIVERSTRING = 'recvr' +character(len=labellength) :: TRANSMITTERSTRING = 'trans' + +! constants required to convert to same units as observations + +real(r8), PARAMETER :: N2_molar_mass = 28.0_r8 ! [g/mol] +real(r8), PARAMETER :: O_molar_mass = 16.0_r8 ! [g/mol] +real(r8), PARAMETER :: O2_molar_mass = 32.0_r8 ! [g/mol] real(r8), PARAMETER :: universal_gas_constant = 8314.0_r8 ! [J/K/kmol] -integer, PARAMETER :: MAXLEVELS = 100 ! more than max levels expected in the model +real(r8), PARAMETER :: k_constant = 1.381e-23_r8 ! [m^2 kg / s^2 / K] +integer, PARAMETER :: MAXLEVELS = 100 ! more than max levels expected in the model character(len=512) :: string1, string2, string3 contains +!----------------------------------------------------------------------- +!> + subroutine initialize_module -!----------------------------------------------------------------------------- + call register_module(source, revision, revdate) module_initialized = .true. +allocate(slant_tec_metadata(MAX_slant_tec_key)) +slant_tec_counter = 0 + end subroutine initialize_module +!----------------------------------------------------------------------- +!> Given DART state vector and a location, +!> it computes thermospheric neutral density [Kg/m3] +!> The istatus variable should be returned as 0 unless there is a problem + subroutine get_expected_upper_atm_density(x, location, obs_val, istatus) -!----------------------------------------------------------------------------- -!Given DART state vector and a location, -!it computes thermospheric neutral density [Kg/m3] -!The istatus variable should be returned as 0 unless there is a problem -! + real(r8), intent(in) :: x(:) type(location_type), intent(in) :: location real(r8), intent(out) :: obs_val @@ -224,23 +273,18 @@ subroutine get_expected_upper_atm_density(x, location, obs_val, istatus) end subroutine get_expected_upper_atm_density +!----------------------------------------------------------------------- +!> Given DART state vector and a location, +!> it computes ground GPS vertical total electron content +!> The istatus variable should be returned as 0 unless there is a problem + subroutine get_expected_gnd_gps_vtec(state_vector, location, obs_val, istatus) -!----------------------------------------------------------------------------- -!Given DART state vector and a location, -!it computes ground GPS vertical total electron content -!The istatus variable should be returned as 0 unless there is a problem -real(r8), intent(in) :: state_vector(:) -type(location_type), intent(in) :: location -real(r8), intent(out) :: obs_val -integer, intent(out) :: istatus -! Given a location and the state vector from one of the ensemble members, -! compute the model-predicted total electron content that would be in the -! integrated column from an instrument looking straight down at the tangent point. -! 'istatus' is the return code. 0 is success; any positive value signals an -! error (different values can be used to indicate different error types). -! Negative istatus values are reserved for internal use only by DART. +real(r8), intent(in) :: state_vector(:) +type(location_type), intent(in) :: location +real(r8), intent(out) :: obs_val +integer, intent(out) :: istatus integer :: nAlts, iAlt real(r8), allocatable :: ALT(:), IDensityS_ie(:) @@ -248,6 +292,13 @@ subroutine get_expected_gnd_gps_vtec(state_vector, location, obs_val, istatus) real(r8) :: tec type(location_type) :: probe +! Given a location and the state vector from one of the ensemble members, +! compute the model-predicted total electron content that would be in the +! integrated column from an instrument looking straight down at the tangent point. +! 'istatus' is the return code. 0 is success; any positive value signals an +! error (different values can be used to indicate different error types). +! Negative istatus values are reserved for internal use only by DART. + if ( .not. module_initialized ) call initialize_module istatus = 36 !initially bad return code @@ -277,7 +328,7 @@ subroutine get_expected_gnd_gps_vtec(state_vector, location, obs_val, istatus) probe = set_location(loc_vals(1), loc_vals(2), real(iAlt, r8), VERTISLEVEL) !probe is where we have data call interpolate(state_vector, probe, KIND_DENSITY_ION_E, IDensityS_ie(iAlt), istatus) if (istatus /= 0) exit LEVELS - call interpolate(state_vector, probe, KIND_GEOPOTENTIAL_HEIGHT, ALT(iAlt), istatus) + call interpolate(state_vector, probe, KIND_GEOMETRIC_HEIGHT, ALT(iAlt), istatus) if (istatus /= 0) exit LEVELS nAlts = nAlts+1 enddo LEVELS @@ -300,33 +351,37 @@ subroutine get_expected_gnd_gps_vtec(state_vector, location, obs_val, istatus) end subroutine get_expected_gnd_gps_vtec -subroutine get_expected_vtec(x, location, obs_val, istatus) -!----------------------------------------------------------------------------- -!Given DART state vector and a location, -!it computes thermospheric neutral density [Kg/m3] -!The istatus variable should be returned as 0 unless there is a problem -! -real(r8), intent(in) :: x(:) +!----------------------------------------------------------------------- +!> Given DART state vector and a location, +!> compute ground GPS vertical total electron content including an estimate of +!> the contribution from above the model (the 'extrap'olated part) +!> The istatus variable should be returned as 0 unless there is a problem + +subroutine get_expected_gps_vtec_extrap(state_vector, location, obs_val, istatus) + +real(r8), intent(in) :: state_vector(:) type(location_type), intent(in) :: location real(r8), intent(out) :: obs_val integer, intent(out) :: istatus if ( .not. module_initialized ) call initialize_module -call error_handler(E_ERR, 'get_expected_vtec', 'routine needs to be written', & - source, revision, revdate) +istatus = 1 +obs_val = MISSING_R8 + +call error_handler(E_ERR, 'get_expected_gps_vtec_extrap', 'routine not written', & + source, revision, revdate, & + text2='routine in obs_def/obs_def_upper_atm_mod.f90') + +! FIXME this should replace the tiegcm/model_mod:create_vtec() routine + +end subroutine get_expected_gps_vtec_extrap -end subroutine get_expected_vtec +!----------------------------------------------------------------------- +!> subroutine get_expected_O_N2_ratio(state_vector, location, obs_val, istatus) -!----------------------------------------------------------------------------- -! -! First, find the number of levels in the model. -! Then, loop down through the levels to create a top-down vertical profile. -! As we do that, we accumulate the amount of N2 and O, stopping when -! the N2 reaches 10^21 M^-2. This will probably mean only using part -! of the 'last' layer. real(r8), intent(in) :: state_vector(:) type(location_type), intent(in) :: location @@ -357,17 +412,23 @@ subroutine get_expected_O_N2_ratio(state_vector, location, obs_val, istatus) real(r8), allocatable :: total_number_density(:) real(r8), allocatable :: O_number_density(:) -real(r8), PARAMETER :: k_constant = 1.381e-23_r8 ! m^2 * kg / s^2 / K +real(r8), parameter :: k_constant = 1.381e-23_r8 ! m^2 * kg / s^2 / K integer :: ilayer, nlevels, nilevels integer :: vstatus(4) real(r8) :: layerfraction +! First, find the number of levels in the model. +! Then, loop down through the levels to create a top-down vertical profile. +! As we do that, we accumulate the amount of N2 and O, stopping when +! the N2 reaches 10^21 M^-2. This will probably mean only using part +! of the 'last' layer. + if ( .not. module_initialized ) call initialize_module istatus = 1 obs_val = MISSING_R8 -call error_handler(E_ERR, 'get_expected_O_N2_ratio', 'routine not tested', & +call error_handler(E_MSG, 'get_expected_O_N2_ratio', 'routine not tested', & source, revision, revdate, & text2='routine in obs_def/obs_def_upper_atm_mod.f90', & text3='test and inform the DART development team. Thanks -- Tim.') @@ -425,9 +486,13 @@ subroutine get_expected_O_N2_ratio(state_vector, location, obs_val, istatus) enddo FILLMIDPOINTS -if (nlevels == 0) return +if (nlevels == 0) then + obs_val = missing_r8 + return +endif ! Check to make sure we have more interfaces than layers. +!>@todo should this be an error instead of a message? if (nilevels /= (nlevels+1)) then write(string1,*)'Require there to be 1 more interfaces than midpoints.' @@ -443,7 +508,7 @@ subroutine get_expected_O_N2_ratio(state_vector, location, obs_val, istatus) allocate(N2_mmr(nlevels), mbar(nlevels), total_number_density(nlevels), & O_number_density(nlevels), N2_number_density(nlevels)) -N2_mmr = 1.0_r8 - O_mmr(1:nlevels) - O2_mmr(1:nlevels) +N2_mmr = 1.0_r8 - O_mmr(1:nlevels) - O2_mmr(1:nlevels) mbar = 1.0_r8/( O2_mmr(1:nlevels)/O2_molar_mass + & O_mmr(1:nlevels)/ O_molar_mass + & N2_mmr(1:nlevels)/N2_molar_mass ) @@ -453,7 +518,7 @@ subroutine get_expected_O_N2_ratio(state_vector, location, obs_val, istatus) total_number_density = pressure(1:nlevels) / (k_constant * temperature(1:nlevels)) - O_number_density = O_mmr(1:nlevels) * mbar / O_molar_mass * total_number_density + O_number_density = O_mmr(1:nlevels) * mbar / O_molar_mass * total_number_density N2_number_density = N2_mmr(1:nlevels) * mbar / N2_molar_mass * total_number_density if ( 1 == 2 ) then ! DEBUG BLOCK NOT IN USE @@ -488,7 +553,7 @@ subroutine get_expected_O_N2_ratio(state_vector, location, obs_val, istatus) if ((N2_total+N2_integrated) >= Max_N2_column_density) then ! only store part of the final layer so as not to overshoot 10^21 m^-2 ! Let y2 == N2_total, y = Max_N2_column_density, y1 = N2_total + N2_integrated - ! the layer fraction is (y - y2)/(y1-y2) + ! the layer fraction is (y - y2)/(y1-y2) ! (Max_N2_column_density - N2_total)/(N2_total + N2_integrated - N2_total) layerfraction = (Max_N2_column_density - N2_total) / N2_integrated N2_total = N2_total + N2_integrated*layerfraction @@ -509,11 +574,304 @@ subroutine get_expected_O_N2_ratio(state_vector, location, obs_val, istatus) end subroutine get_expected_O_N2_ratio +!----------------------------------------------------------------------- +!> Given DART state vector and a location, +!> compute ground GPS vertical total electron content including an estimate of +!> the contribution from above the model (the 'extra'polated part) +!> The istatus variable should be returned as 0 unless there is a problem + +subroutine get_expected_slant_tec(state_vector, location, key, obs_val, istatus) + +real(r8), intent(in) :: state_vector(:) +type(location_type), intent(in) :: location +integer, intent(in) :: key ! into module metadata +real(r8), intent(out) :: obs_val +integer, intent(out) :: istatus + +type(location_type) :: recvr_location +type(location_type) :: trans_location + +call error_handler(E_ERR, 'get_expected_slant_tec', 'method not tested', & + source, revision, revdate, text2='consider this "pre-alpha"') + +if ( .not. module_initialized ) call initialize_module + +istatus = 1 +obs_val = MISSING_R8 + +call get_slant_tec_metadata(key, recvr_location, trans_location ) + +end subroutine get_expected_slant_tec + + +!----------------------------------------------------------------------- +!> read_slant_tec_metadata reads the metadata for slant tec observations +!> from an observation sequence file and fills a local array. + +subroutine read_slant_tec_metadata(key, obsID, ifile, fform) + +integer, intent(out) :: key ! index into local metadata +integer, intent(in) :: obsID +integer, intent(in) :: ifile +character(len=*), intent(in), optional :: fform + +! temp variables +logical :: is_asciifile +integer :: ierr +character(len=labellength) :: header +type(location_type) :: recvr_location, trans_location + +call error_handler(E_ERR, 'read_slant_tec_metadata', 'method not tested', & + source, revision, revdate, text2='consider this "pre-alpha"') + +if ( .not. module_initialized ) call initialize_module + +is_asciifile = ascii_file_format(fform) + +write(string2,*)'observation #',obsID + +! Read the receiver location after confirming we are in sync + +if ( is_asciifile ) then + read(ifile, *, iostat=ierr) header + call check_iostat(ierr,'read_slant_tec_metadata','ASCII receiver header',string2) +else + read(ifile, iostat=ierr) header + call check_iostat(ierr,'read_slant_tec_metadata','binary receiver header',string2) +endif + +if (trim(header) /= trim(RECEIVERSTRING)) then + write(string1,*)"Expected slant tec receiver header ["//trim(RECEIVERSTRING),& + &"] in input file, got ["//header//"]" + call error_handler(E_ERR, 'read_slant_tec_metadata', string1, & + source, revision, revdate, text2=string2) +endif + +recvr_location = read_location(ifile, fform) + +! Read the transmitter location after confirming we are in sync + +if ( is_asciifile ) then + read(ifile, *, iostat=ierr) header + call check_iostat(ierr,'read_slant_tec_metadata','ASCII transmitter header',string2) +else + read(ifile, iostat=ierr) header + call check_iostat(ierr,'read_slant_tec_metadata','binary transmitter header',string2) +endif + +if (trim(header) /= trim(TRANSMITTERSTRING)) then + write(string1,*)"Expected slant tec transmitter header ["//trim(TRANSMITTERSTRING),& + &"] in input file, got ["//header//"]" + call error_handler(E_ERR, 'read_slant_tec_metadata', string1, & + source, revision, revdate, text2=string2) +endif + +trans_location = read_location(ifile, fform) + +! Store the metadata in module storage and record the new length of the metadata arrays. +call set_slant_tec_metadata(key, recvr_location, trans_location) + +end subroutine read_slant_tec_metadata + + +!----------------------------------------------------------------------- +!> writes the metadata for slant tec observations. + +subroutine write_slant_tec_metadata(key, ifile, fform) + +integer, intent(in) :: key +integer, intent(in) :: ifile +character(len=*), intent(in), optional :: fform + +logical :: is_asciifile +type(location_type) :: recvr_location, trans_location + +call error_handler(E_ERR, 'write_slant_tec_metadata', 'method not tested', & + source, revision, revdate, text2='consider this "pre-alpha"') + +if ( .not. module_initialized ) call initialize_module + +! given the index into the local metadata arrays - retrieve +! the metadata for this particular observation. + +call get_slant_tec_metadata(key, recvr_location, trans_location) + +is_asciifile = ascii_file_format(fform) + +if (is_asciifile) then + write(ifile, *) trim(RECEIVERSTRING) +else + write(ifile ) trim(RECEIVERSTRING) +endif +call write_location(ifile, recvr_location, fform) + +if (is_asciifile) then + write(ifile, *) trim(TRANSMITTERSTRING) +else + write(ifile ) trim(TRANSMITTERSTRING) +endif +call write_location(ifile, trans_location, fform) + +end subroutine write_slant_tec_metadata + + +!----------------------------------------------------------------------- +!> + +subroutine interactive_slant_tec_metadata(key) + +integer, intent(out) :: key + +type(location_type) :: recvr_location +type(location_type) :: trans_location + +call error_handler(E_ERR, 'interactive_slant_tec_metadata', 'method not tested', & + source, revision, revdate, text2='consider this "pre-alpha"') + +if ( .not. module_initialized ) call initialize_module + +! Prompt for input for the required metadata + +write(*,*)'Enter location of receiver' +call interactive_location(recvr_location) + +write(*,*)'Enter location of transmitter' +call interactive_location(trans_location) + +call set_slant_tec_metadata(key, recvr_location, trans_location) + +end subroutine interactive_slant_tec_metadata + + +!----------------------------------------------------------------------- +!> Common code to increment the current key count, and set the private +!> contents of this observation's auxiliary data. + +subroutine set_slant_tec_metadata(key, recvr_location, trans_location ) + +integer, intent(out) :: key +type(location_type), intent(in) :: recvr_location +type(location_type), intent(in) :: trans_location + +if ( .not. module_initialized ) call initialize_module + +slant_tec_counter = slant_tec_counter + 1 + +! Make sure the new key is within the length of the metadata arrays. +call grow_metadata(slant_tec_counter,'set_slant_tec_metadata') + +key = slant_tec_counter ! now that we know it is legal + +slant_tec_metadata(key)%receiver_location = recvr_location +slant_tec_metadata(key)%transmitter_location = trans_location + +end subroutine set_slant_tec_metadata + + +!----------------------------------------------------------------------- +!> Common code to increment the current key count, and set the private +!> contents of this observation's auxiliary data. + +subroutine get_slant_tec_metadata(key, recvr_location, trans_location ) + + +integer, intent(in) :: key +type(location_type), intent(out) :: recvr_location +type(location_type), intent(out) :: trans_location + +if ( .not. module_initialized ) call initialize_module + +! Make sure the new key is within the length of the metadata arrays. +call key_within_range(key,'get_slant_tec_metadata') + +recvr_location = slant_tec_metadata(key)%receiver_location +trans_location = slant_tec_metadata(key)%transmitter_location + +end subroutine get_slant_tec_metadata + + +!----------------------------------------------------------------------- +!> + +subroutine check_iostat(istat, routine, varname, msgstring) + +integer, intent(in) :: istat +character(len=*), intent(in) :: routine +character(len=*), intent(in) :: varname +character(len=*), intent(in) :: msgstring + +if ( istat /= 0 ) then + write(string1,*)'istat should be 0 but is ',istat,' for ['//varname//']' + call error_handler(E_ERR, routine, string1, source, revision, revdate, text2=msgstring) +end if + +end subroutine check_iostat + + +!----------------------------------------------------------------------- +!> Make sure we are addressing within the metadata arrays + +subroutine key_within_range(key, routine) + +integer, intent(in) :: key +character(len=*), intent(in) :: routine + +! fine -- no problem. +if ((key > 0) .and. (key <= slant_tec_counter)) return + +! Bad news. Tell the user. +write(string1, *) 'key (',key,') not within known range ( 1,', slant_tec_counter,')' +call error_handler(E_ERR,routine,string1,source,revision,revdate) + +end subroutine key_within_range + + +!----------------------------------------------------------------------- +!> If the allocatable metadata arrays are not big enough ... try again + +subroutine grow_metadata(key, routine) + +integer, intent(in) :: key +character(len=*), intent(in) :: routine + +integer :: orglength +type(slant_tec_type), allocatable :: safe_metadata(:) + +! fine -- no problem. +if ((key > 0) .and. (key <= MAX_slant_tec_key)) return + +orglength = MAX_slant_tec_key +MAX_slant_tec_key = 2 * orglength + +! Check for some error conditions. +if (key < 1) then + write(string1, *) 'key (',key,') must be >= 1' + call error_handler(E_ERR,routine,string1,source,revision,revdate) +elseif (key >= 2*MAX_slant_tec_key) then + write(string1, *) 'key (',key,') really unexpected.' + write(string2, *) 'doubling storage will not help.' + call error_handler(E_ERR,routine,string1,source,revision,revdate, & + text2=string2) +endif + +! News. Tell the user we are increasing storage. +write(string1, *) 'key (',key,') exceeds MAX_slant_tec_key (',orglength,')' +write(string2, *) 'Increasing MAX_slant_tec_key to ',MAX_slant_tec_key +call error_handler(E_MSG,routine,string1,source,revision,revdate,text2=string2) + +allocate(safe_metadata(orglength)) +safe_metadata(:) = slant_tec_metadata(:) + +deallocate(slant_tec_metadata) + allocate(slant_tec_metadata(MAX_slant_tec_key)) + +slant_tec_metadata(1:orglength) = safe_metadata(:) + +deallocate(safe_metadata) + +end subroutine grow_metadata + + end module obs_def_upper_atm_mod -! END DART PREPROCESS MODULE CODE +! END DART PREPROCESS MODULE CODE -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_kind/DEFAULT_obs_kind_mod.F90 b/obs_kind/DEFAULT_obs_kind_mod.F90 index 911539a3ba..c93787550f 100644 --- a/obs_kind/DEFAULT_obs_kind_mod.F90 +++ b/obs_kind/DEFAULT_obs_kind_mod.F90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ !---------------------------------------------------------------------- ! WARNING!! The file obs_kind_mod.f90 is AUTOGENERATED by the @@ -278,7 +276,8 @@ module obs_kind_mod ! more kinds for TIEGCM Alex Chartier integer, parameter, public :: & KIND_VERTICAL_TEC = 143, & - KIND_O_N2_COLUMN_DENSITY_RATIO = 144 + KIND_O_N2_COLUMN_DENSITY_RATIO = 144, & + KIND_SLANT_TEC = 145 !! For now we have agreed to reserve kind numbers 151 to 250 !! for chemistry types, specifically for WRF-Chem/DART, but @@ -336,8 +335,18 @@ module obs_kind_mod KIND_VELOCITY_VERTICAL_NO = 284, & KIND_GND_GPS_VTEC = 285, & KIND_DENSITY_ION_OP = 286, & - KIND_TOTAL_ELECTRON_CONTENT = 287 - + KIND_TOTAL_ELECTRON_CONTENT = 287, & + KIND_MASS_DENSITY = 288 + +! kinds for GOLD assimilation (George Bowden) +integer, parameter, public :: & + KIND_NEMAX_DISK = 289, & + KIND_ON2_DISK = 290 + +! kinds for TIEGCM state vector (George Bowden) +integer, parameter, public :: & + KIND_MOLEC_NITROGEN_MIXING_RATIO = 291 + ! more land kinds integer, parameter, public :: & KIND_BRIGHTNESS_TEMPERATURE = 300, & @@ -377,10 +386,9 @@ module obs_kind_mod !---------------------------------------------------------------------------- ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'DEFAULT_obs_kind_mod.F90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical, save :: module_initialized = .false. @@ -618,16 +626,17 @@ subroutine initialize_module obs_kind_names(141) = obs_kind_type(KIND_CANOPY_WATER ,'KIND_CANOPY_WATER') obs_kind_names(142) = obs_kind_type(KIND_GROUND_HEAT_FLUX ,'KIND_GROUND_HEAT_FLUX') obs_kind_names(143) = obs_kind_type(KIND_VERTICAL_TEC ,'KIND_VERTICAL_TEC') -obs_kind_names(144) = obs_kind_type(KIND_O_N2_COLUMN_DENSITY_RATIO, 'KIND_O_N2_COLUMN_DENSITY_RATIO') +obs_kind_names(144) = obs_kind_type(KIND_O_N2_COLUMN_DENSITY_RATIO ,'KIND_O_N2_COLUMN_DENSITY_RATIO') +obs_kind_names(145) = obs_kind_type(KIND_SLANT_TEC ,'KIND_SLANT_TEC') -obs_kind_names(151) = obs_kind_type(KIND_O3, 'KIND_O3') -obs_kind_names(153) = obs_kind_type(KIND_CO, 'KIND_CO') -obs_kind_names(155) = obs_kind_type(KIND_NO, 'KIND_NO') -obs_kind_names(156) = obs_kind_type(KIND_NO2, 'KIND_NO2') +obs_kind_names(151) = obs_kind_type(KIND_O3 ,'KIND_O3') +obs_kind_names(153) = obs_kind_type(KIND_CO ,'KIND_CO') +obs_kind_names(155) = obs_kind_type(KIND_NO ,'KIND_NO') +obs_kind_names(156) = obs_kind_type(KIND_NO2 ,'KIND_NO2') -obs_kind_names(247) = obs_kind_type(KIND_CO2, 'KIND_CO2') -obs_kind_names(248) = obs_kind_type(KIND_NH3, 'KIND_NH3') -obs_kind_names(249) = obs_kind_type(KIND_CH4, 'KIND_CH4') +obs_kind_names(247) = obs_kind_type(KIND_CO2 ,'KIND_CO2') +obs_kind_names(248) = obs_kind_type(KIND_NH3 ,'KIND_NH3') +obs_kind_names(249) = obs_kind_type(KIND_CH4 ,'KIND_CH4') obs_kind_names(251) = obs_kind_type(KIND_TEMPERATURE_ELECTRON ,'KIND_TEMPERATURE_ELECTRON') obs_kind_names(252) = obs_kind_type(KIND_TEMPERATURE_ION ,'KIND_TEMPERATURE_ION') @@ -666,6 +675,10 @@ subroutine initialize_module obs_kind_names(285) = obs_kind_type(KIND_GND_GPS_VTEC ,'KIND_GND_GPS_VTEC') obs_kind_names(286) = obs_kind_type(KIND_DENSITY_ION_OP ,'KIND_DENSITY_ION_OP') obs_kind_names(287) = obs_kind_type(KIND_TOTAL_ELECTRON_CONTENT,'KIND_TOTAL_ELECTRON_CONTENT') +obs_kind_names(288) = obs_kind_type(KIND_MASS_DENSITY ,'KIND_MASS_DENSITY') +obs_kind_names(289) = obs_kind_type(KIND_NEMAX_DISK ,'KIND_NEMAX_DISK') +obs_kind_names(290) = obs_kind_type(KIND_ON2_DISK ,'KIND_ON2_DISK') +obs_kind_names(291) = obs_kind_type(KIND_MOLEC_NITROGEN_MIXING_RATIO,'KIND_MOLEC_NITROGEN_MIXING_RATIO') obs_kind_names(300) = obs_kind_type(KIND_BRIGHTNESS_TEMPERATURE,'KIND_BRIGHTNESS_TEMPERATURE') obs_kind_names(301) = obs_kind_type(KIND_VEGETATION_TEMPERATURE,'KIND_VEGETATION_TEMPERATURE') @@ -1422,8 +1435,3 @@ end function do_obs_form_pair end module obs_kind_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_model/obs_model_mod.f90 b/obs_model/obs_model_mod.f90 index a70794c4c2..ed13d83fb4 100644 --- a/obs_model/obs_model_mod.f90 +++ b/obs_model/obs_model_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module obs_model_mod @@ -33,10 +31,9 @@ module obs_model_mod public :: move_ahead, advance_state, set_obs_model_trace, have_members ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_model_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical :: module_initialized = .false. integer :: print_timestamps = 0 @@ -686,8 +683,3 @@ end function have_members end module obs_model_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_sequence/create_fixed_network_seq.f90 b/obs_sequence/create_fixed_network_seq.f90 index 5b035373a4..9492395820 100644 --- a/obs_sequence/create_fixed_network_seq.f90 +++ b/obs_sequence/create_fixed_network_seq.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program create_fixed_network_seq @@ -24,10 +22,9 @@ program create_fixed_network_seq implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'create_fixed_network_seq.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' type(obs_sequence_type) :: seq, seq_in @@ -192,8 +189,3 @@ program create_fixed_network_seq end program create_fixed_network_seq -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_sequence/create_obs_sequence.f90 b/obs_sequence/create_obs_sequence.f90 index 463fca2ce3..0d7f630605 100644 --- a/obs_sequence/create_obs_sequence.f90 +++ b/obs_sequence/create_obs_sequence.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program create_obs_sequence @@ -15,10 +13,9 @@ program create_obs_sequence implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'create_obs_sequence.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' type(obs_sequence_type) :: seq character(len=256) :: file_name @@ -47,8 +44,3 @@ program create_obs_sequence end program create_obs_sequence -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_sequence/obs_seq_to_netcdf.f90 b/obs_sequence/obs_seq_to_netcdf.f90 index 80b7abb0ae..fea1af736e 100644 --- a/obs_sequence/obs_seq_to_netcdf.f90 +++ b/obs_sequence/obs_seq_to_netcdf.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program obs_seq_to_netcdf @@ -46,10 +44,9 @@ program obs_seq_to_netcdf implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_seq_to_netcdf.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !--------------------------------------------------------------------- !--------------------------------------------------------------------- @@ -1264,8 +1261,3 @@ end function NC_Compatibility_Check end program obs_seq_to_netcdf -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_sequence/obs_sequence_mod.f90 b/obs_sequence/obs_sequence_mod.f90 index 49d07dc831..cafa5ac327 100644 --- a/obs_sequence/obs_sequence_mod.f90 +++ b/obs_sequence/obs_sequence_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module obs_sequence_mod @@ -62,10 +60,9 @@ module obs_sequence_mod public :: obs_cov_type ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_sequence_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' type obs_sequence_type private @@ -2686,8 +2683,3 @@ end function get_num_key_range end module obs_sequence_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/obs_sequence/obs_sequence_tool.f90 b/obs_sequence/obs_sequence_tool.f90 index 95b6778a4c..410796fd4f 100644 --- a/obs_sequence/obs_sequence_tool.f90 +++ b/obs_sequence/obs_sequence_tool.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ !> Change observation sequence files by adding or removing observations !> based on type, location, values, time. Long list of options based on @@ -42,10 +40,9 @@ program obs_sequence_tool implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_sequence_tool.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' type(obs_sequence_type) :: seq_in, seq_out type(obs_type) :: obs_in, next_obs_in @@ -1602,8 +1599,3 @@ end subroutine set_new_data !--------------------------------------------------------------------- end program obs_sequence_tool -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/observations/CHAMP/CHAMP_density_text_to_obs.f90 b/observations/CHAMP/CHAMP_density_text_to_obs.f90 index 5c81870d36..9e31d0e06c 100644 --- a/observations/CHAMP/CHAMP_density_text_to_obs.f90 +++ b/observations/CHAMP/CHAMP_density_text_to_obs.f90 @@ -1,42 +1,35 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! DART $Id$ program CHAMP_density_text_to_obs !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! -! CHAMP_density_text_to_obs - a program that only needs minor customization to read -! in a text-based dataset - either white-space separated values or -! fixed-width column data. -! -! created 29 Mar 2010 nancy collins NCAR/IMAGe +! CHAMP_density_text_to_obs - reads fixed-format ASCII files from +! http://sisko.colorado.edu/sutton/data/ver2.2/champ/density/2002/ascii/ +! work/Density_3deg_02_335.ascii is an example of an input file ! -!+ modified 15 Aug 2012 Alexey Morozov (Univ. of Michigan), alexeymor at google mail +! created 29 Mar 2010 Nancy Collins NCAR/IMAGe +! modified 15 Aug 2012 Alexey Morozov (Univ. of Michigan) +! modified 25 May 2016 Tim Hoar NCAR/IMAGe ! -!+ It is designed to read CHAMP ascii files -!+ For example of input files, see Density_3deg_02_335.ascii in work folder, which is taken from -! http://sisko.colorado.edu/sutton/data/ver2.2/champ/density/2002/ascii/ -!+ This program reads the name of the text file, obs_seq file, and "debug" from input.nml -!+ APPENDS new observations to existing obs_seq.out - see line 130ish -!+ (but not if you change the obs_out_file in input.nml) -!+ For added convenience, see convert.sh in work folder, which runs this program repeatedly -!+ to convert+append many CHAMP files -!+ Implemented the suggestion about times starting from weird points (like 335th day in 2002) -!+ - see lines 190ish +! Since the GRACE and CHAMP data available from Erik Sutton are in the +! same format, this converter now has namelist options to specify the +! observation type of the output. Appending to an existing file +! (inserting, actually) is also namelist-controlled. ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -use types_mod, only : r8, PI, DEG2RAD +use types_mod, only : r8, PI, DEG2RAD, obstypelength -use utilities_mod, only : initialize_utilities, finalize_utilities, & - open_file, close_file, find_namelist_in_file, check_namelist_read +use utilities_mod, only : initialize_utilities, finalize_utilities, to_upper, & + open_file, close_file, find_namelist_in_file, & + check_namelist_read, error_handler, E_MSG, E_ERR -use time_manager_mod, only : time_type, set_calendar_type, set_date, & - operator(>=), increment_time, get_time, set_time, & - operator(-), GREGORIAN, operator(+), print_date +use time_manager_mod, only : time_type, set_calendar_type, GREGORIAN, & + set_date, set_time, get_time, print_date, & + operator(-), operator(+), operator(>=) use location_mod, only : VERTISHEIGHT @@ -47,27 +40,38 @@ program CHAMP_density_text_to_obs use obs_utilities_mod, only : create_3d_obs, add_obs_to_seq -use obs_kind_mod, only : SAT_RHO !this is density +use obs_kind_mod, only : CHAMP_DENSITY, SAT_RHO implicit none -! things which can/should be in the text_to_obs_nml +! version controlled file description for error handling, do not edit +character(len=*), parameter :: source = 'CHAMP_density_text_to_obs.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' -character(len=64) :: text_input_file = 'Density_3deg_02_335_2p2.ascii' -character(len=64) :: obs_out_file = 'obs_seq.out' -logical :: debug = .true. +! things which can/should be in the namelist + +character(len=256) :: text_input_file = 'Density_3deg_05_020.ascii' +character(len=256) :: obs_out_file = 'obs_seq.out' +character(len=obstypelength) :: observation_type = 'CHAMP_DENSITY' +logical :: append_to_existing_file = .false. +logical :: debug = .true. namelist /CHAMP_density_text_to_obs_nml/ & text_input_file, & obs_out_file, & + observation_type, & + append_to_existing_file, & debug - -character (len=200) :: input_line !162 is the width of CHAMPdens2.2 files, but to be safe do 200 +character(len=512) :: string1, string2 +character(len=1024) :: input_line !162 is the nominal width of CHAMPdens2.2 data records, + ! but the second line, the descriptor, has 731 characters. integer :: oday, osec, rcio, iunit integer :: year, day, second -integer :: num_copies, num_qc, max_obs +integer :: num_copies, num_qc, max_obs, linenum +integer :: observation_type_int logical :: file_exist, first_obs @@ -93,15 +97,18 @@ program CHAMP_density_text_to_obs read(iunit, nml = CHAMP_density_text_to_obs_nml, iostat = rcio) call check_namelist_read(iunit, rcio, 'CHAMP_density_text_to_obs_nml') +call set_observation_type() + ! time setup call set_calendar_type(GREGORIAN) - ! open input text file - iunit = open_file(text_input_file, 'formatted', 'read') -if (debug) print *, 'opened input file ' // trim(text_input_file) +write(string1,*) 'opened input file "' // trim(text_input_file) // '"' +write(string2,*) 'converting them as observation type '//trim(observation_type) +call error_handler(E_MSG, 'CHAMP_density_text_to_obs', string1, & + source, revision, revdate, text2=string2) ! each observation in this series will have a single observation value ! and a quality control flag. the max possible number of obs needs to @@ -125,24 +132,51 @@ program CHAMP_density_text_to_obs call set_copy_meta_data(obs_seq, 1, 'observation') call set_qc_meta_data(obs_seq, 1, 'Data QC') -! if you want to append to existing files (e.g. you have a lot of +! If you want to append to existing files (e.g. you have a lot of ! small text files you want to combine), you can do it this way, ! or you can use the obs_sequence_tool to merge a list of files ! once they are in DART obs_seq format. -! existing file found, append to it -inquire(file=obs_out_file, exist=file_exist) -if ( file_exist ) then - call read_obs_seq(obs_out_file, 0, 0, max_obs, obs_seq) +if (append_to_existing_file) then + inquire(file=obs_out_file, exist=file_exist) + if ( file_exist ) then + write(string1,*)'.. inserting into "'//trim(obs_out_file)//'"' + call error_handler(E_MSG,'CHAMP_density_text_to_obs',string1) + call read_obs_seq(obs_out_file, 0, 0, max_obs, obs_seq) + endif endif ! Set the DART data quality control. 0 is good data. ! increasingly larger QC values are more questionable quality data. qc = 0.0_r8 -! first two lines are just text (description), so just skip them -read(iunit, "(A)", iostat=rcio) input_line -read(iunit, "(A)", iostat=rcio) input_line +! The first line is the version and origin information. +! The second line is a description of the columns and units. +! As long as these are constant, we can skip them. +! column 01 * Two-digit Year (years) +! column 02 * Day of the Year (days) +! column 03 * Second of the Day (GPS time,sec) +! column 04 * Center Latitude of 3-degree Bin (deg) +! column 05 * Satellite Geodetic Latitude (deg) +! column 06 * Satellite Longitude (deg) +! column 07 * Satellite Height (km) +! column 08 * Satellite Local Time (hours) +! column 09 * Satellite Quasi-Dipole Latitude (deg) +! column 10 * Satellite Magnetic Longitude (deg) +! column 11 * Satellite Magnetic Local Time (hours) +! column 12 * Neutral Density (kg/m^3) +! column 13 * Neutral Density Normalized to 400km using NRLMSISe00 +! column 14 * Neutral Density Normalized to 410km using NRLMSISe00 +! column 15 * NRLMSISe00 Neutral Density at Satellite Height +! column 15 * Uncertainty in Neutral Density (kg/m^3) +! column 17 * Number of Data Points in Current Averaging Bin +! column 18 * Number of Points in Current Averaging Bin that Required Interpolation +! column 19 * Average Coefficient of Drag Used in Current Averaging Bin + +read(iunit,"(A)") input_line +read(iunit,"(A)") input_line + +linenum = 2 obsloop: do ! no end limit - have the loop break when input ends @@ -153,14 +187,26 @@ program CHAMP_density_text_to_obs ! error: very important - the instrument error plus representativeness error ! (see html file for more info) - ! read the whole line into a buffer + ! read the whole line into a buffer and parse it later read(iunit, "(A)", iostat=rcio) input_line - if (rcio /= 0) then - if (debug) print *, 'got bad read code from input file, rcio = ', rcio + + if (rcio < 0) then + write(string1,*) trim(text_input_file)//' had ', linenum-2,' observations.' + call error_handler(E_MSG,'CHAMP_density_text_to_obs',string1, & + source, revision, revdate) exit obsloop endif - ! assume here is a line from sisko.colorado.edu/sutton/data/ver2.2/champ/density/2002/ascii/, + if (rcio /= 0) then + write(string1,*) 'got bad read code (', rcio,') on line ',linenum + write(string2,*) 'of ',trim(text_input_file) + call error_handler(E_ERR,'CHAMP_density_text_to_obs',string1, & + source, revision, revdate, text2=string2) + endif + + linenum = linenum + 1 + + ! here is a line from sisko.colorado.edu/sutton/data/ver2.2/champ/density/2002/ascii/, !data format is: !+ 1)year(2I), 2)day(3I), 3)second(8.3F), 4)round(lat), 5)lat(d,-90 90), 6)lon(d,-180 180), 7)alt(km), !+ 8)LT, 9)Mlat, 10)Mlon, 11)MLT, 12)Rho(Density!), 13)MSISRho400, 14)MSISRho410, 15)MSISRhoSat @@ -173,29 +219,28 @@ program CHAMP_density_text_to_obs terr, ignore_i, & ignore_i, ignore_r - vert=vert*1000 !DART needs alt in m, whereas in champ files it's in km - if (rcio /= 0) then - if (debug) print *, 'got bad read code getting rest of temp obs, rcio = ', rcio - exit obsloop + write(string1,*) 'unable to parse line ',linenum + write(string2,*) 'of ',trim(text_input_file) + call error_handler(E_ERR,'CHAMP_density_text_to_obs',string1, & + source, revision, revdate, text2=string2) endif - if (debug) print *, 'this observation located at lat, lon = ', lat, lon + vert = vert * 1000.0_r8 ! DART needs alt in meters, CHAMP has km + + if (debug) print *, 'this observation located at lat, lon, vert = ', lat, lon, vert ! if lon comes in between -180 and 180, use these lines instead: if ( lat > 90.0_r8 .or. lat < -90.0_r8 ) cycle obsloop if ( lon > 180.0_r8 .or. lon < -180.0_r8 ) cycle obsloop - if ( lon < 0.0_r8 ) lon = lon + 360.0_r8 ! changes into 0-360 + if ( lon < 0.0_r8 ) lon = lon + 360.0_r8 ! changes into 0-360 ! put date into a dart time format - year = 2000 + year !because year in file is (2I) - 2 digits - second = nint(second_r) + year = 2000 + year !because year in file is (2I) - 2 digits + comp_day0 = set_date(year, 1, 1, 0, 0, 0) ! always Jan 1 of whatever year. + second = nint(second_r) - !! some times are supplied as number of seconds since some reference - !! date. This is an example of how to support that. - !! put the reference date into DART format - comp_day0 = set_date(year, 1, 1, 0, 0, 0) time_obs = comp_day0 + set_time(second, day-1) ! extract time of observation into gregorian day, sec. @@ -203,14 +248,13 @@ program CHAMP_density_text_to_obs if (debug) call print_date(time_obs, 'this obs time is') - ! height is in kilometers (yardstick) ! make an obs derived type, and then add it to the sequence call create_3d_obs(lat, lon, vert, VERTISHEIGHT, temp, & - SAT_RHO, terr, oday, osec, qc, obs) + observation_type_int, terr, oday, osec, qc, obs) call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) - if (debug) print *, 'added RHO obs to output seq' + if (debug) print *, 'added '//trim(observation_type)//' obs to output seq' end do obsloop @@ -219,15 +263,42 @@ program CHAMP_density_text_to_obs !if (debug) print *, 'writing obs_seq, obs_count = ', get_num_obs(obs_seq) print *, 'writing obs_seq, obs_count = ', get_num_obs(obs_seq) call write_obs_seq(obs_seq, obs_out_file) +else + call error_handler(E_MSG,'CHAMP_density_text_to_obs','no observations in sequence', & + source, revision, revdate) endif ! end of main program call finalize_utilities() -end program CHAMP_density_text_to_obs +contains + +!----------------------------------------------------------------------- +!> + +subroutine set_observation_type + +! sets the global variable 'observation_type_int' based on the character +! string namelist input 'observation_type' -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ +character(len=obstypelength) :: observation_string + +! must create local copy because to_upper works in-place +observation_string = observation_type +call to_upper(observation_string) + +if (trim(observation_string) == 'CHAMP_DENSITY') then + observation_type_int = CHAMP_DENSITY +elseif (trim(observation_string) == 'SAT_RHO') then + observation_type_int = SAT_RHO +else + write(string1,*)'Unable to interpret observation string "'//trim(observation_type)//'"' + write(string2,*)'valid strings are "CHAMP_DENSITY" or "SAT_RHO"' + call error_handler(E_ERR, 'CHAMP_density_text_to_obs', string1, & + source, revision, revdate, text2=string2) +endif + +end subroutine set_observation_type + + +end program CHAMP_density_text_to_obs diff --git a/observations/CHAMP/CHAMP_density_text_to_obs.html b/observations/CHAMP/CHAMP_density_text_to_obs.html new file mode 100644 index 0000000000..8478569d70 --- /dev/null +++ b/observations/CHAMP/CHAMP_density_text_to_obs.html @@ -0,0 +1,320 @@ + + + +program CHAMP_to_obs + + + + + + +

    PROGRAM CHAMP_to_obs

    + + + + + + +
    + DART project logo + +

    Jump to DART Documentation Main Index
    + version information for this file:
    + + $Id$
    +

    + +DATA SOURCES / +PROGRAMS / +NAMELIST / +REFERENCES / +ERRORS / +PLANS / +TERMS OF USE + +

    Overview

    + +

    CHAMP "Version 2.2" ASCII File to DART Observation Converter

    + +

    +The ASCII neutral density files for both CHAMP and GRACE created by Erik Sutton at +
    +http://sisko.colorado.edu/sutton/data/ver2.2/champ/density +
    +http://sisko.colorado.edu/sutton/data/ver2.2/grace/density +
    can be converted to DART observation sequence files with +CHAMP_density_text_to_obs since the files share the same format. +
    +
    +Be aware that it is possible to automatically insert new observations into +an existing obs_seq.out by using the namelist options. +This allows work/convert.sh +to process sequentially numbered Density_*.ascii files +and create a single file without requiring the use of obs_sequence_tool. +You are encouraged to read the comments inside convert.sh. +

    + + + + +
    [top]

    +

    DATA SOURCES

    + +

    +The CHAMP and GRACE neutral densities can be found at +
    +http://sisko.colorado.edu/sutton/data/ver2.2/champ/density, and +
    +http://sisko.colorado.edu/sutton/data/ver2.2/grace/density, respectively. +
    +
    +The ASCII version of the data come bundled in files with names like +Density_3deg_2002.ascii.tar.gz. The remaining instruction +assume you have downloaded these files and put them in the +CHAMP/downloads directory. Note the chmod +is not technically necessary, but I see no reason to have execute permission +on data files, nor do I need to be able to modify them ... hence the '444'. +

    +
    +
    +cd CHAMP/data
    +tar -zxvf ../downloads/Density_3deg_2002.ascii.tar.gz
    +chmod 444 2002/*.ascii
    +
    +
    +

    +This should expand into a CHAMP/data/2002 directory with a +file for each day. These are the input for the converter. The first line has +the version and origin information, the second line has the format for the rest +of the lines in the file - i.e. an explanation of the columns. The first two +lines are actually ignored by the converter. +Lines 3-N constitute the data. +

    + + + + +
    [top]

    +

    PROGRAMS

    + +

    CHAMP_density_text_to_obs

    +

    +The CHAMP_density_text_to_obs.f90 file is the source code +for the main converter program. +CHAMP_density_text_to_obs +reads each text line into a character buffer +and then reads from that buffer to parse up the data items. +

    + +

    The data format supported by the converter is:

    + + + + + + + + + + + + + + + + + + + + + +
    column   content
    1 Two-digit Year (years)
    2 Day of the Year (days)
    3 Second of the Day (GPS time,sec)
    4 Center Latitude of 3-degree Bin (deg)
    5 Satellite Geodetic Latitude (deg)
    6 Satellite Longitude (deg)
    7 Satellite Height (km)
    8 Satellite Local Time (hours)
    9 Satellite Quasi-Dipole Latitude (deg)
    10 Satellite Magnetic Longitude (deg)
    11 Satellite Magnetic Local Time (hours)
    12 Neutral Density (kg/m^3)
    13 Neutral Density Normalized to 400km using NRLMSISe00
    14 Neutral Density Normalized to 410km using NRLMSISe00
    15 NRLMSISe00 Neutral Density at Satellite Height
    15 Uncertainty in Neutral Density (kg/m^3)
    17 Number of Data Points in Current Averaging Bin
    18 Number of Points in Current Averaging Bin that Required Interpolation
    19 Average Coefficient of Drag Used in Current Averaging Bin
    + +

    obs_sequence_tool

    +

    +The obs_sequence/obs_sequence_tool.f90 may be used to combine multiple observation sequence files into a single file, etc. +See the obs_sequence_tool.html for details. +

    + +

    advance_time

    +

    +The time_manager/advance_time.f90 may also be +useful when scripting to set the time ranges. +See the advance_time.html for details. +

    + +

    Compiling and Testing

    +

    +To compile and test, go into the CHAMP/work subdirectory and +run the quickbuild.csh +script to build the converter and a couple of general purpose utilities. +The obs_sequence_tool +manipulates (i.e. combines, subsets) DART observation files once they have been created. +The default observations supported are those defined in +DART/obs_def/obs_def_upper_atm_mod.f90. +If you need additional observation types, you will have to add the +appropriate obs_def_XXX_mod.f90 file to the +input.nml &preprocess_nml:input_files +variable and run quickbuild.csh again. +It rebuilds the table of supported observation types before +compiling the source code. +

    + +

     

    + + + + + + +
    [top]

    +

    NAMELIST

    +

    +This namelist is read from the file input.nml. +Namelists start with an ampersand +'&' and terminate with a slash '/'. +Character strings that contain a '/' must be +enclosed in quotes to prevent them from +prematurely terminating the namelist. +

    + +
    +
    +&CHAMP_density_text_to_obs_nml
    +   text_input_file         = "../data/2002/Density_3deg_02_338.ascii"
    +   obs_out_file            = "obs_seq.out"
    +   observation_type        = "CHAMP_NEUTRAL_DENSITY"
    +   append_to_existing_file = .false.
    +   debug                   = .false.
    +  /
    +
    +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    Contents Type Description
    text_input_filecharacter(len=256)The text file containing the raw observations for each site. +
    obs_out_filecharacter(len=256)The output observation sequence file for DART. +
    observation_typecharacter(len=32)The output observation TYPE. + Possible choices are + "CHAMP_MASS_DENSITY", + "SAT_RHO" + Distinguishing between the satellites allows for a more thorough analysis later. +
    append_to_existing_filelogicalA switch to specify whether or not you want to append the new observations + onto an existing observation sequence file. +
    .true. append to the existing observation sequence file. +
    .false. create a new file, wiping out any existing file. +
    debuglogicalA switch to specify the amount of run-time output. +
    .true. the most amount of output. +
    .false. the least amount of output. +
    + +
    + +

     

    + + + + + + +
    [top]

    +

    References

    + + + + + + + +
    [top]

    +

    KNOWN BUGS

    +

    +none +

    + + + + + + +
    [top]

    +

    FUTURE PLANS

    +

    +none +

    + + + + + + +
    [top]

    +

    Terms of Use

    + +

    +DART software - Copyright 2004 - 2013 UCAR.
    +This open source software is provided by UCAR, "as is",
    +without charge, subject to all terms of use at
    + +http://www.image.ucar.edu/DAReS/DART/DART_download +

    + + + + + + + +
    Contact: Tim Hoar
    Revision: $Revision$
    Source: $URL$
    Change Date: $Date$
    Change history:  try "svn log" or "svn diff"
    + + + + + diff --git a/observations/CHAMP/CHAMP_density_text_to_obs.nml b/observations/CHAMP/CHAMP_density_text_to_obs.nml new file mode 100644 index 0000000000..bedb275354 --- /dev/null +++ b/observations/CHAMP/CHAMP_density_text_to_obs.nml @@ -0,0 +1,11 @@ + +# Valid "observation_type"s are: CHAMP_MASS_DENSITY or SAT_RHO + +&CHAMP_density_text_to_obs_nml + text_input_file = "../data/2005/Density_3deg_05_020.ascii" + obs_out_file = "obs_seq.out" + observation_type = "CHAMP_MASS_DENSITY" + append_to_existing_file = .false. + debug = .false. + / + diff --git a/observations/CHAMP/work/README b/observations/CHAMP/work/README index da501f03f3..3a097e53b4 100644 --- a/observations/CHAMP/work/README +++ b/observations/CHAMP/work/README @@ -1,19 +1,20 @@ This is just a modification of a standard "text" converter that comes with DART. -It reads CHAMP and GRACE text Density files (which used to be at +It reads CHAMP and GRACE text Density files (which USED to be at sisko.colorado.edu/sutton/data.html) and outputs DART obs_seq.out files. -Be aware that if obs_seq.out already exists, it automatically adds new +(TJH - Wed May 18 10:17:17 MDT 2016 - source files now at:) +http://sisko.colorado.edu/sutton/data/ver2.2/champ/density/ +http://sisko.colorado.edu/sutton/data/ver2.2/grace/density + +Be aware that if obs_seq.out already exists, it optionally adds new observations to that file without deleting it. This is done to allow the wrapper script (work/convert.sh) to process sequentially numbered Density_*.ascii files (read comments inside convert.sh). -If this is not the behavior you want, comment out lines 129-132 in -text_to_obs.f90 and rebuild. - -Please check out work/input.nml:&text_to_obs_nml as it specifies the -name of the input and the output +If this is not the behavior you want, check the namelist option +&CHAMP_density_text_to_obs_nml:append_to_existing_file -The work/Density_3deg_02_335.ascii is truncated to 2 datapoints to +The example file work/Density_3deg_02_335.ascii is truncated to 2 datapoints to demonstrate the format and is not to be used for real experiments. Alexey Morozov alexeymor at google mail 5/22/13 diff --git a/observations/CHAMP/work/convert.sh b/observations/CHAMP/work/convert.sh index 685cdab9ff..bb7d13e3bb 100755 --- a/observations/CHAMP/work/convert.sh +++ b/observations/CHAMP/work/convert.sh @@ -1,11 +1,9 @@ #!/bin/bash # -# DART software - Copyright 2004 - 2013 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download # -# DART $Id$ -# # runs t2o multiple times to convert multiple CHAMP files and append the # resulting files to obs_seq.out (or the obs_out_file specified in # input.nml&text_to_obs_nml ) @@ -26,15 +24,7 @@ nd=4 for (( i = 1 ; i <= $nd; i++ )) do echo $i - sed -i '.tmp' 's/text_input_file.*/text_input_file = "Density_3deg_02_'$[$d1+$i-1]'.ascii"/' input.nml - ./text_to_obs > temp + sed -i '.tmp' 's#text_input_file.*#text_input_file = "../data/2002/Density_3deg_02_'$[$d1+$i-1]'.ascii"#' input.nml + ./CHAMP_density_text_to_obs done -#shows how many observations are there total -tail temp - -# -# $URL$ -# $Revision$ -# $Date$ - diff --git a/observations/CHAMP/work/input.nml b/observations/CHAMP/work/input.nml index ffcd741ac9..2126d10116 100644 --- a/observations/CHAMP/work/input.nml +++ b/observations/CHAMP/work/input.nml @@ -1,16 +1,20 @@ &preprocess_nml - input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90', - output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90', - input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90', - output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90', - input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' + input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90' + output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90' + input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90' + output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90' + input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' / +# Valid "observation_type"s are: CHAMP_MASS_DENSITY or SAT_RHO + &CHAMP_density_text_to_obs_nml - text_input_file = "Density_3deg_02_335.ascii" - obs_out_file = "obs_seq.out", - debug = .false. + text_input_file = '../data/2005/Density_3deg_05_020.ascii' + obs_out_file = 'obs_seq.out' + observation_type = 'CHAMP_DENSITY' + append_to_existing_file = .true. + debug = .false. / &obs_kind_nml @@ -55,13 +59,13 @@ / &location_nml - horiz_dist_only = .false., - vert_normalization_pressure = 100000.0, - vert_normalization_height = 100000.0, - vert_normalization_level = 20.0, - approximate_distance = .false., - nlon = 71, - nlat = 36, + horiz_dist_only = .false. + vert_normalization_pressure = 100000.0 + vert_normalization_height = 100000.0 + vert_normalization_level = 20.0 + approximate_distance = .false. + nlon = 71 + nlat = 36 output_box_info = .true. / diff --git a/observations/CHAMP/work/obs_seq.out b/observations/CHAMP/work/obs_seq.out index f1ab9b8823..ce82545f88 100644 --- a/observations/CHAMP/work/obs_seq.out +++ b/observations/CHAMP/work/obs_seq.out @@ -1,7 +1,7 @@ obs_sequence obs_kind_definitions 1 - 37 SAT_RHO + 37 CHAMP_DENSITY num_copies: 1 num_qc: 1 num_obs: 4 max_num_obs: 4 observation diff --git a/observations/CNOFS/README b/observations/CNOFS/README new file mode 100644 index 0000000000..0a7e80fd89 --- /dev/null +++ b/observations/CNOFS/README @@ -0,0 +1,10 @@ +Wed May 25 10:57:22 MDT 2016 + +If you are trying to convert radio occultation observations from the COSMIC Data Analysis +and Archive Center (CDAAC) http://cdaac-www.cosmic.ucar.edu/cdaac/index.html +you should explore the observations/gps converter before trying to coerce your observations +into an ascii file that matches the format expected by CNOFS_text_to_obs.f90. + +The observations/gps converters work with ionPrf and atmPrf. It may be trivial to +extend to other satellite/data products. + diff --git a/observations/CNOFS/work/input.nml b/observations/CNOFS/work/input.nml index 33fac52d05..0640d5102a 100644 --- a/observations/CNOFS/work/input.nml +++ b/observations/CNOFS/work/input.nml @@ -1,15 +1,15 @@ &CNOFS_text_to_obs_nml - text_input_file = "cnofs_jan_2012_data_assim.ivm", - obs_out_file = "obs_seq.out", + text_input_file = 'cnofs_jan_2012_data_assim.ivm' + obs_out_file = 'obs_seq.out' debug = .false. / &preprocess_nml - input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90', - output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90', - input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90', - output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90', + input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90' + output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90' + input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90' + output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90' input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' / @@ -55,13 +55,13 @@ / &location_nml - horiz_dist_only = .false., - vert_normalization_pressure = 100000.0, - vert_normalization_height = 100000.0, - vert_normalization_level = 20.0, - approximate_distance = .false., - nlon = 71, - nlat = 36, + horiz_dist_only = .false. + vert_normalization_pressure = 100000.0 + vert_normalization_height = 100000.0 + vert_normalization_level = 20.0 + approximate_distance = .false. + nlon = 71 + nlat = 36 output_box_info = .true. / diff --git a/observations/GOLD/convert_gold_combined.f90 b/observations/GOLD/convert_gold_combined.f90 new file mode 100644 index 0000000000..ce2979b047 --- /dev/null +++ b/observations/GOLD/convert_gold_combined.f90 @@ -0,0 +1,430 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! $Id$ + +program convert_gold_combined + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! convert_gold_nmax - program that reads a GOLD netCDF TDISK and ON2 +! observation files and writes a DART +! obs_seq file using the DART library routines. +! +! created Dec. 2007 Ryan Torn, NCAR/MMM (MADIS) +! modified Dec. 2008 Soyoung Ha and David Dowell, NCAR/MMM (MADIS) +! modified Aug. 2020 George Bowden, UNSW Canberra +! +! modified to use a common set of utilities, better netcdf error checks, +! able to insert obs with any time correctly (not only monotonically +! increasing times) nancy collins, ncar/image 11 march 2010 +! +! keep original obs times, make source for all converters as similar +! as possbile. nancy collins, ncar/image 26 march 2010 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +use types_mod, only : r8, missing_r8 +use location_mod, only : VERTISHEIGHT, VERTISPRESSURE, VERTISUNDEF +use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & + find_namelist_in_file, check_namelist_read +use time_manager_mod, only : time_type, set_calendar_type, set_date, operator(>=), & + increment_time, get_time, operator(-), GREGORIAN +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, write_obs_seq, & + init_obs_sequence, get_num_obs, & + set_copy_meta_data, set_qc_meta_data + +use obs_kind_mod, only : GOLD_TEMPERATURE, GOLD_ON2COLUMN, GOLD_NEMAX +use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, & + getvar_real_3d, & + create_3d_obs, getvar_int, getdimlen, set_missing_name + +use netcdf + +implicit none + +!character(len=13), parameter :: gold_netcdf_file = 'gold_input.nc' +!character(len=129), parameter :: gold_out_file = 'obs_seq.gold' + +! things which can/should be in the nc_to_obs_nml +character(len=128) :: gold_tdisk_netcdf_file = 'gold_tdisk_input.nc' +character(len=128) :: gold_on2_netcdf_file = 'gold_on2_input.nc' +character(len=128) :: gold_nemax_netcdf_file = 'gold_nemax_input.nc' +character(len=128) :: gold_out_file = 'obs_seq.gold' +logical :: use_tdisk = .true. +logical :: use_on2 = .true. +logical :: use_nemax = .true. +logical :: debug = .true. + +namelist /GOLD_combined_nc_to_obs_nml/ & + gold_tdisk_netcdf_file, & + gold_on2_netcdf_file, & + gold_nemax_netcdf_file, & + gold_out_file, & + use_tdisk, & + use_on2, & + use_nemax, & + debug + +logical, parameter :: use_input_qc = .true. + +integer, parameter :: num_copies = 1, & ! number of copies in sequence + num_qc = 1 ! number of QC entries + +integer :: ncid_tdisk, ncid_on2, ncid_nemax +integer :: nvars +integer :: i, oday, osec, nused, iunit, rcio +integer :: nobs_tdisk, nlat_tdisk, nlon_tdisk, nscan_tdisk, nmsl_tdisk +integer :: nobs_on2, nlat_on2, nlon_on2, nscan_on2, nmsl_on2 +integer :: nobs_nemax, nlat_nemax, nlon_nemax, nscan_nemax, nmsl_nemax + +integer :: k, l, m, n, j +integer :: varid + +logical :: file_exist, first_obs + +real(r8) :: pres, height, qc, qerr, oerr +real(r8) :: tdisk_miss, on2_miss, nemax_miss + +integer :: year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs + +character, allocatable :: tobs_tdisk(:,:,:,:) +real(r8), allocatable :: lat_tdisk(:,:,:), lon_tdisk(:,:,:) +character, allocatable :: tobs_on2(:,:,:,:) +real(r8), allocatable :: lat_on2(:,:,:), lon_on2(:,:,:) +character, allocatable :: tobs_nemax(:,:,:) +real(r8), allocatable :: lat_nemax(:,:,:), lon_nemax(:,:,:) + +real(r8), allocatable :: tdisk(:,:,:), tdisk_unc_ran(:,:,:), & + tdisk_unc_sys(:,:,:), tdisk_unc_mod(:,:,:) +real(r8), allocatable :: on2(:,:,:), on2_unc_ran(:,:,:), & + on2_unc_sys(:,:,:), on2_unc_mod(:,:,:) +real(r8), allocatable :: nemax(:,:,:), nemax_unc_ran(:,:,:), & + nemax_unc_sys(:,:,:), nemax_unc_mod(:,:,:) + +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, prev_time + +character(len = 8), parameter :: varname_time_utc = 'time_utc' +character(len = 24) :: tobs_string = '1970-01-01T00:00:00.000Z' + + +call initialize_utilities('convert_gold_combined') + +! Read the DART namelist for this model +call find_namelist_in_file('input.nml', 'GOLD_combined_nc_to_obs_nml', iunit) +read(iunit, nml = GOLD_combined_nc_to_obs_nml, iostat = rcio) +call check_namelist_read(iunit, rcio, 'GOLD_combined_nc_to_obs_nml') + +!print*,gold_netcdf_file + +! put the reference date into DART format +call set_calendar_type(GREGORIAN) + +first_obs = .true. + +call nc_check( nf90_open(gold_tdisk_netcdf_file, nf90_nowrite, ncid_tdisk), & + 'convert_gold_combined', 'opening file '//trim(gold_tdisk_netcdf_file) ) +call nc_check( nf90_open(gold_on2_netcdf_file, nf90_nowrite, ncid_on2), & + 'convert_gold_combined', 'opening file '//trim(gold_on2_netcdf_file) ) +call nc_check( nf90_open(gold_nemax_netcdf_file, nf90_nowrite, ncid_nemax), & + 'convert_gold_combined', 'opening file '//trim(gold_nemax_netcdf_file) ) + +call getdimlen(ncid_tdisk, "nlats", nlat_tdisk) +call getdimlen(ncid_tdisk, "nlons", nlon_tdisk) +call getdimlen(ncid_tdisk, "nscans", nscan_tdisk) +call getdimlen(ncid_tdisk, "max_string_len ", nmsl_tdisk) +call set_missing_name("missing_value") + +call getdimlen(ncid_on2, "nlats", nlat_on2) +call getdimlen(ncid_on2, "nlons", nlon_on2) +call getdimlen(ncid_on2, "nscans", nscan_on2) +call getdimlen(ncid_on2, "max_string_len ", nmsl_on2) +call set_missing_name("missing_value") + +call getdimlen(ncid_nemax, "nlats", nlat_nemax) +call getdimlen(ncid_nemax, "nlons", nlon_nemax) +call getdimlen(ncid_nemax, "nscans", nscan_nemax) +call getdimlen(ncid_nemax, "max_string_len ", nmsl_nemax) +call set_missing_name("missing_value") + +nobs_tdisk = nlat_tdisk * nlon_tdisk * nscan_tdisk +nobs_on2 = nlat_on2 * nlon_on2 * nscan_on2 +nobs_nemax = nlat_nemax * nlon_nemax * nscan_nemax +nvars = 1 +! Check meaning of nvars + +! Allocate arrays for tdisk +allocate( lat_tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( lon_tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_ran(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_sys(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_mod(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_tdisk(24,nlon_tdisk,nlat_tdisk,nscan_tdisk)) + +! Allocate arrays for on2 +allocate( lat_on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( lon_on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_ran(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_sys(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_mod(nlon_on2,nlat_on2,nscan_on2)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_on2(24,nlon_on2,nlat_on2,nscan_on2)) + +! Allocate arrays for nemax +allocate( lat_nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( lon_nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_ran(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_sys(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_mod(nlon_nemax,nlat_nemax,nscan_nemax)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_nemax(24,nlon_nemax,nscan_nemax)) + +! read in the data arrays for tdisk +call getvar_real_3d(ncid_tdisk, "latitude", lat_tdisk) ! latitudes +call getvar_real_3d(ncid_tdisk, "longitude", lon_tdisk) ! longitudes +call getvar_real_3d(ncid_tdisk, "tdisk", tdisk, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_ran", tdisk_unc_ran, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_sys", tdisk_unc_sys, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_mod", tdisk_unc_mod, tdisk_miss) ! maximum electron concentration + +! read in the data arrays for on2 +call getvar_real_3d(ncid_on2, "latitude", lat_on2) ! latitudes +call getvar_real_3d(ncid_on2, "longitude", lon_on2) ! longitudes +call getvar_real_3d(ncid_on2, "on2", on2, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_ran", on2_unc_ran, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_sys", on2_unc_sys, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_mod", on2_unc_mod, on2_miss) ! maximum electron concentration + +! read in the data arrays for nemax +call getvar_real_3d(ncid_nemax, "latitude", lat_nemax) ! latitudes +call getvar_real_3d(ncid_nemax, "longitude", lon_nemax) ! longitudes +call getvar_real_3d(ncid_nemax, "nmax", nemax, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_ran", nemax_unc_ran, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_sys", nemax_unc_sys, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_mod", nemax_unc_mod, nemax_miss) ! maximum electron concentration + +! read the data for the time array tdisk +call nc_check( nf90_inq_varid(ncid_tdisk, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_tdisk, varid, tobs_tdisk, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon_tdisk, nlat_tdisk, nscan_tdisk /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +! read the data for the time array on2 +call nc_check( nf90_inq_varid(ncid_on2, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_on2, varid, tobs_on2, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon_on2, nlat_on2, nscan_on2 /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +! read the data for the time array nemax +call nc_check( nf90_inq_varid(ncid_nemax, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_nemax, varid, tobs_nemax, & + start = (/ 1, 1, 1 /), count = (/ 24, nlon_nemax, nscan_nemax /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +call nc_check( nf90_close(ncid_tdisk), & + 'convert_gold_combined', 'closing file '//trim(gold_tdisk_netcdf_file) ) +call nc_check( nf90_close(ncid_on2), & + 'convert_gold_combined', 'closing file '//trim(gold_on2_netcdf_file) ) +call nc_check( nf90_close(ncid_nemax), & + 'convert_gold_combined', 'closing file '//trim(gold_nemax_netcdf_file) ) + +! either read existing obs_seq or create a new one +call static_init_obs_sequence() +call init_obs(obs, num_copies, num_qc) +call init_obs(prev_obs, num_copies, num_qc) + +inquire(file=gold_out_file, exist=file_exist) + +if ( file_exist ) then + + ! existing file found, append to it + call read_obs_seq(gold_out_file, 0, 0, nvars*(nobs_tdisk + nobs_on2 + nobs_nemax), obs_seq) + +else + + ! create a new one + call init_obs_sequence(obs_seq, num_copies, num_qc, nvars*(nobs_tdisk + nobs_on2 + nobs_nemax)) + do i = 1, num_copies + call set_copy_meta_data(obs_seq, i, 'GOLD observation') + end do + do i = 1, num_qc + call set_qc_meta_data(obs_seq, i, 'Data QC') + end do + +endif + +! Set the DART data quality control. Be consistent with NCEP codes; +! 0 is 'must use', 1 is good, no reason not to use it. +qc = 1.0_r8 + +year_obs = 1970 +month_obs = 1 +day_obs = 1 +hour_obs = 0 +minute_obs = 0 +second_obs = 0 + +nused = 0 +scanloop_tdisk: do k = 1, nscan_tdisk + lonloop_tdisk: do l = 1, nlon_tdisk + latloop_tdisk: do m = 1, nlat_tdisk + + if ('*' == tobs_tdisk(1,l,m,k)) cycle latloop_tdisk + do j = 1, 24 + tobs_string(j:j) = tobs_tdisk(j,l,m,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + if (.not. (lon_tdisk(l,m,k) < 180.0_r8 .and. lon_tdisk(l,m,k) > -180.0_r8)) cycle latloop_tdisk + if (.not. (lat_tdisk(l,m,k) < 90.0_r8 .and. lat_tdisk(l,m,k) > -90.0_r8)) cycle latloop_tdisk + + if ( lon_tdisk(l,m,k) < 0.0_r8 ) lon_tdisk(l,m,k) = lon_tdisk(l,m,k) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Fixed height of 150 km + height = 1.5E5 + + !oerr = (tdisk_unc_ran(l,m,k)**2.0 + tdisk_unc_sys(l,m,k)**2.0)**0.5 + oerr = tdisk_unc_ran(l,m,k) + + !if (not(isnan(tdisk(l,m,k)))) then + if ((not(isnan(tdisk(l,m,k)))) .and. (not(isnan(oerr)))) then + call create_3d_obs(lat_tdisk(l,m,k), lon_tdisk(l,m,k), height, VERTISHEIGHT, tdisk(l,m,k), & + GOLD_TEMPERATURE, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop_tdisk + end do lonloop_tdisk +end do scanloop_tdisk + +scanloop_on2: do k = 1, nscan_on2 + lonloop_on2: do l = 1, nlon_on2 + latloop_on2: do m = 1, nlat_on2 + + if ('*' == tobs_on2(1,l,m,k)) cycle latloop_on2 + do j = 1, 24 + tobs_string(j:j) = tobs_on2(j,l,m,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + if (.not. (lon_on2(l,m,k) < 180.0_r8 .and. lon_on2(l,m,k) > -180.0_r8)) cycle latloop_on2 + if (.not. (lat_on2(l,m,k) < 90.0_r8 .and. lat_on2(l,m,k) > -90.0_r8)) cycle latloop_on2 + + if ( lon_on2(l,m,k) < 0.0_r8 ) lon_on2(l,m,k) = lon_on2(l,m,k) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Not sure what to do about altitude coordinate, not included in GOLD file + !pres = 5.0E-5 + ! Fixed height of 150 km + height = 1.5E5 + + oerr = (on2_unc_ran(l,m,k)**2.0 + on2_unc_sys(l,m,k)**2.0)**0.5 + + if ((not(isnan(on2(l,m,k)))) .and. (not(isnan(oerr)))) then + !call create_3d_obs(lat_on2(l,m,k), lon_on2(l,m,k), pres, VERTISPRESSURE, on2(l,m,k), & + ! GOLD_ON2COLUMN, oerr, oday, osec, qc, obs) + call create_3d_obs(lat_on2(l,m,k), lon_on2(l,m,k), height, VERTISUNDEF , on2(l,m,k), & + GOLD_ON2COLUMN, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop_on2 + end do lonloop_on2 +end do scanloop_on2 + +scanloop_nemax: do k = 1, nscan_nemax + lonloop_nemax: do l = 1, nlon_nemax + + if ('*' == tobs_nemax(1,l,k)) cycle lonloop_nemax + do j = 1, 24 + tobs_string(j:j) = tobs_nemax(j,l,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + latloop_nemax: do m = 1, nlat_nemax + + if (.not. (lon_nemax(l,m,k) < 180.0_r8 .and. lon_nemax(l,m,k) > -180.0_r8)) cycle latloop_nemax + if (.not. (lat_nemax(l,m,k) < 90.0_r8 .and. lat_nemax(l,m,k) > -90.0_r8)) cycle latloop_nemax + + if ( lon_nemax(l,m,k) < 0.0_r8 ) lon_nemax(l,m,k) = lon_nemax(l,m,k) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Not sure what to do about altitude coordinate, not included in GOLD file + !pres = 5.0E-5 + ! Fixed height of 150 km + height = 1.5E5 + + oerr = (nemax_unc_ran(l,m,k)**2.0 + nemax_unc_sys(l,m,k)**2.0)**0.5 + + if ((not(isnan(nemax(l,m,k)))) .and. (not(isnan(oerr)))) then + !call create_3d_obs(lat_nemax(l,m,k), lon_nemax(l,m,k), pres, VERTISPRESSURE, nemax(l,m,k), & + ! GOLD_NEMAX, oerr, oday, osec, qc, obs) + call create_3d_obs(lat_nemax(l,m,k), lon_nemax(l,m,k), height, VERTISUNDEF , nemax(l,m,k), & + GOLD_NEMAX, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop_nemax + end do lonloop_nemax +end do scanloop_nemax + +100 continue + +print*,"Finished processing, about to write" + +! if we added any obs to the sequence, write it now. +if ( get_num_obs(obs_seq) > 0 ) call write_obs_seq(obs_seq, gold_out_file) + +! end of main program +call finalize_utilities() + + +end program convert_gold_combined + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ diff --git a/observations/GOLD/convert_gold_combined_mess.f90 b/observations/GOLD/convert_gold_combined_mess.f90 new file mode 100644 index 0000000000..eea843644e --- /dev/null +++ b/observations/GOLD/convert_gold_combined_mess.f90 @@ -0,0 +1,641 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! $Id$ + +program convert_gold_combined + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! convert_gold_nmax - program that reads a GOLD netCDF TDISK and ON2 +! observation files and writes a DART +! obs_seq file using the DART library routines. +! +! created Dec. 2007 Ryan Torn, NCAR/MMM (MADIS) +! modified Dec. 2008 Soyoung Ha and David Dowell, NCAR/MMM (MADIS) +! modified Aug. 2020 George Bowden, UNSW Canberra +! +! modified to use a common set of utilities, better netcdf error checks, +! able to insert obs with any time correctly (not only monotonically +! increasing times) nancy collins, ncar/image 11 march 2010 +! +! keep original obs times, make source for all converters as similar +! as possbile. nancy collins, ncar/image 26 march 2010 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +use types_mod, only : r8, missing_r8 +use location_mod, only : VERTISHEIGHT, VERTISPRESSURE +use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & + find_namelist_in_file, check_namelist_read +use time_manager_mod, only : time_type, set_calendar_type, set_date, operator(>=), & + increment_time, get_time, operator(-), GREGORIAN +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, write_obs_seq, & + init_obs_sequence, get_num_obs, & + set_copy_meta_data, set_qc_meta_data + +use obs_kind_mod, only : GOLD_TEMPERATURE, GOLD_ON2COLUMN, GOLD_NEMAX +use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, & + getvar_real_3d, & + create_3d_obs, getvar_int, getdimlen, set_missing_name + +use netcdf + +implicit none + +!character(len=13), parameter :: gold_netcdf_file = 'gold_input.nc' +!character(len=129), parameter :: gold_out_file = 'obs_seq.gold' + +! things which can/should be in the nc_to_obs_nml +character(len=128) :: gold_tdisk_netcdf_file = 'gold_tdisk_input.nc' +character(len=128) :: gold_on2_netcdf_file = 'gold_on2_input.nc' +character(len=128) :: gold_nemax_netcdf_file = 'gold_nemax_input.nc' +character(len=128) :: gold_out_file = 'obs_seq.gold' +logical :: use_tdisk = .true. +logical :: use_on2 = .true. +logical :: use_nemax = .true. +logical :: debug = .true. + +namelist /GOLD_combined_nc_to_obs_nml/ & + gold_tdisk_netcdf_file, & + gold_on2_netcdf_file, & + gold_nemax_netcdf_file, & + gold_out_file, & + use_tdisk, & + use_on2, & + use_nemax, & + debug + +logical, parameter :: use_input_qc = .true. + +integer, parameter :: num_copies = 1, & ! number of copies in sequence + num_qc = 1 ! number of QC entries + +integer :: ncid_tdisk, ncid_on2, ncid_nemax +integer :: nvars +integer :: i, oday, osec, nused, iunit, rcio +integer :: nobs_tdisk, nlat_tdisk, nlon_tdisk, nscan_tdisk, nmsl_tdisk +integer :: nobs_on2, nlat_on2, nlon_on2, nscan_on2, nmsl_on2 +integer :: nobs_nemax, nlat_nemax, nlon_nemax, nscan_nemax, nmsl_nemax + +integer :: k, l, m, n, j +integer :: varid + +logical :: file_exist, first_obs + +real(r8) :: pres, height, qc, qerr, oerr +real(r8) :: tdisk_miss, on2_miss, nemax_miss + +integer :: year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs + +character, allocatable :: tobs_tdisk(:,:,:,:) +real(r8), allocatable :: lat_tdisk(:,:,:), lon_tdisk(:,:,:) +character, allocatable :: tobs_on2(:,:,:,:) +real(r8), allocatable :: lat_on2(:,:,:), lon_on2(:,:,:) +character, allocatable :: tobs_nemax(:,:,:) +real(r8), allocatable :: lat_nemax(:,:,:), lon_nemax(:,:,:) + +real(r8), allocatable :: tdisk(:,:,:), tdisk_unc_ran(:,:,:), & + tdisk_unc_sys(:,:,:), tdisk_unc_mod(:,:,:) +real(r8), allocatable :: on2(:,:,:), on2_unc_ran(:,:,:), & + on2_unc_sys(:,:,:), on2_unc_mod(:,:,:) +real(r8), allocatable :: nemax(:,:,:), nemax_unc_ran(:,:,:), & + nemax_unc_sys(:,:,:), nemax_unc_mod(:,:,:) + +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, prev_time + +character(len = 8), parameter :: varname_time_utc = 'time_utc' +character(len = 24) :: tobs_string = '1970-01-01T00:00:00.000Z' + + +call initialize_utilities('convert_gold_combined') + +! Read the DART namelist for this model +call find_namelist_in_file('input.nml', 'GOLD_combined_nc_to_obs_nml', iunit) +read(iunit, nml = GOLD_combined_nc_to_obs_nml, iostat = rcio) +call check_namelist_read(iunit, rcio, 'GOLD_combined_nc_to_obs_nml') + +!print*,gold_netcdf_file + +! put the reference date into DART format +call set_calendar_type(GREGORIAN) + +first_obs = .true. + +call nc_check( nf90_open(gold_tdisk_netcdf_file, nf90_nowrite, ncid_tdisk), & + 'convert_gold_combined', 'opening file '//trim(gold_tdisk_netcdf_file) ) +call nc_check( nf90_open(gold_on2_netcdf_file, nf90_nowrite, ncid_on2), & + 'convert_gold_combined', 'opening file '//trim(gold_on2_netcdf_file) ) +call nc_check( nf90_open(gold_nemax_netcdf_file, nf90_nowrite, ncid_nemax), & + 'convert_gold_combined', 'opening file '//trim(gold_nemax_netcdf_file) ) + +call getdimlen(ncid_tdisk, "nlats", nlat_tdisk) +call getdimlen(ncid_tdisk, "nlons", nlon_tdisk) +call getdimlen(ncid_tdisk, "nscans", nscan_tdisk) +call getdimlen(ncid_tdisk, "max_string_len ", nmsl_tdisk) +call set_missing_name("missing_value") + +call getdimlen(ncid_on2, "nlats", nlat_on2) +call getdimlen(ncid_on2, "nlons", nlon_on2) +call getdimlen(ncid_on2, "nscans", nscan_on2) +call getdimlen(ncid_on2, "max_string_len ", nmsl_on2) +call set_missing_name("missing_value") + +call getdimlen(ncid_nemax, "nlats", nlat_nemax) +call getdimlen(ncid_nemax, "nlons", nlon_nemax) +call getdimlen(ncid_nemax, "nscans", nscan_nemax) +call getdimlen(ncid_nemax, "max_string_len ", nmsl_nemax) +call set_missing_name("missing_value") + +nobs_tdisk = nlat_tdisk * nlon_tdisk * nscan_tdisk +nobs_on2 = nlat_on2 * nlon_on2 * nscan_on2 +nobs_nemax = nlat_nemax * nlon_nemax * nscan_nemax +nvars = 1 +! Check meaning of nvars + +! Allocate arrays for tdisk +allocate( lat_tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( lon_tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_ran(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_sys(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_mod(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_tdisk(24,nlon_tdisk,nlat_tdisk,nscan_tdisk)) + +! Allocate arrays for on2 +allocate( lat_on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( lon_on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_ran(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_sys(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_mod(nlon_on2,nlat_on2,nscan_on2)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_on2(24,nlon_on2,nlat_on2,nscan_on2)) + +! Allocate arrays for nemax +allocate( lat_nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( lon_nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_ran(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_sys(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_mod(nlon_nemax,nlat_nemax,nscan_nemax)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_nemax(24,nlon_nemax,nscan_nemax)) + +! read in the data arrays for tdisk +call getvar_real_3d(ncid_tdisk, "latitude", lat_tdisk) ! latitudes +call getvar_real_3d(ncid_tdisk, "longitude", lon_tdisk) ! longitudes +call getvar_real_3d(ncid_tdisk, "tdisk", tdisk, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_ran", tdisk_unc_ran, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_sys", tdisk_unc_sys, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_mod", tdisk_unc_mod, tdisk_miss) ! maximum electron concentration + +! read in the data arrays for on2 +call getvar_real_3d(ncid_on2, "latitude", lat_on2) ! latitudes +call getvar_real_3d(ncid_on2, "longitude", lon_on2) ! longitudes +call getvar_real_3d(ncid_on2, "on2", on2, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_ran", on2_unc_ran, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_sys", on2_unc_sys, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_mod", on2_unc_mod, on2_miss) ! maximum electron concentration + +! read in the data arrays for nemax +call getvar_real_3d(ncid_nemax, "latitude", lat_nemax) ! latitudes +call getvar_real_3d(ncid_nemax, "longitude", lon_nemax) ! longitudes +call getvar_real_3d(ncid_nemax, "nmax", nemax, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_ran", nemax_unc_ran, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_sys", nemax_unc_sys, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_mod", nemax_unc_mod, nemax_miss) ! maximum electron concentration + +! read the data for the time array tdisk +call nc_check( nf90_inq_varid(ncid_tdisk, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_tdisk, varid, tobs_tdisk, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon_tdisk, nlat_tdisk, nscan_tdisk /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +! read the data for the time array on2 +call nc_check( nf90_inq_varid(ncid_on2, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_on2, varid, tobs_on2, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon_on2, nlat_on2, nscan_on2 /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +! read the data for the time array nemax +call nc_check( nf90_inq_varid(ncid_nemax, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_nemax, varid, tobs_nemax, & + start = (/ 1, 1, 1 /), count = (/ 24, nlon_nemax, nscan_nemax /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +call nc_check( nf90_close(ncid_tdisk), & + ' +! +! modified to use a common set of utilities, better netcdf error checks, +! able to insert obs with any time correctly (not only monotonically +! increasing times) nancy collins, ncar/image 11 march 2010 +! +! keep original obs times, make source for all converters as similar +! as possbile. nancy collins, ncar/image 26 march 2010 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +use types_mod, only : r8, missing_r8 +use location_mod, only : VERTISHEIGHT, VERTISPRESSURE +use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & + find_namelist_in_file, check_namelist_read +use time_manager_mod, only : time_type, set_calendar_type, set_date, operator(>=), & + increment_time, get_time, operator(-), GREGORIAN +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, write_obs_seq, & + init_obs_sequence, get_num_obs, & + set_copy_meta_data, set_qc_meta_data + +use obs_kind_mod, only : GOLD_TEMPERATURE, GOLD_ON2COLUMN, GOLD_NEMAX +use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, & + getvar_real_3d, & + create_3d_obs, getvar_int, getdimlen, set_missing_name + +use netcdf + +implicit none + +!character(len=13), parameter :: gold_netcdf_file = 'gold_input.nc' +!character(len=129), parameter :: gold_out_file = 'obs_seq.gold' + +! things which can/should be in the nc_to_obs_nml +character(len=128) :: gold_tdisk_netcdf_file = 'gold_tdisk_input.nc' +character(len=128) :: gold_on2_netcdf_file = 'gold_on2_input.nc' +character(len=128) :: gold_nemax_netcdf_file = 'gold_nemax_input.nc' +character(len=128) :: gold_out_file = 'obs_seq.gold' +logical :: use_tdisk = .true. +logical :: use_on2 = .true. +logical :: use_nemax = .true. +logical :: debug = .true. + +namelist /GOLD_combined_nc_to_obs_nml/ & + gold_tdisk_netcdf_file, & + gold_on2_netcdf_file, & + gold_nemax_netcdf_file, & + gold_out_file, & + use_tdisk, & + use_on2, & + use_nemax, & + debug + +logical, parameter :: use_input_qc = .true. + +integer, parameter :: num_copies = 1, & ! number of copies in sequence + num_qc = 1 ! number of QC entries + +integer :: ncid_tdisk, ncid_on2, ncid_nemax +integer :: nvars +integer :: i, oday, osec, nused, iunit, rcio +integer :: nobs_tdisk, nlat_tdisk, nlon_tdisk, nscan_tdisk, nmsl_tdisk +integer :: nobs_on2, nlat_on2, nlon_on2, nscan_on2, nmsl_on2 +integer :: nobs_nemax, nlat_nemax, nlon_nemax, nscan_nemax, nmsl_nemax + +integer :: k, l, m, n, j +integer :: varid + +logical :: file_exist, first_obs + +real(r8) :: pres, height, qc, qerr, oerr +real(r8) :: tdisk_miss, on2_miss, nemax_miss + +integer :: year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs + +character, allocatable :: tobs_tdisk(:,:,:,:) +real(r8), allocatable :: lat_tdisk(:,:,:), lon_tdisk(:,:,:) +character, allocatable :: tobs_on2(:,:,:,:) +real(r8), allocatable :: lat_on2(:,:,:), lon_on2(:,:,:) +character, allocatable :: tobs_nemax(:,:,:) +real(r8), allocatable :: lat_nemax(:,:,:), lon_nemax(:,:,:) + +real(r8), allocatable :: tdisk(:,:,:), tdisk_unc_ran(:,:,:), & + tdisk_unc_sys(:,:,:), tdisk_unc_mod(:,:,:) +real(r8), allocatable :: on2(:,:,:), on2_unc_ran(:,:,:), & + on2_unc_sys(:,:,:), on2_unc_mod(:,:,:) +real(r8), allocatable :: nemax(:,:,:), nemax_unc_ran(:,:,:), & + nemax_unc_sys(:,:,:), nemax_unc_mod(:,:,:) + +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, prev_time + +character(len = 8), parameter :: varname_time_utc = 'time_utc' +character(len = 24) :: tobs_string = '1970-01-01T00:00:00.000Z' + + +call initialize_utilities('convert_gold_combined') + +! Read the DART namelist for this model +call find_namelist_in_file('input.nml', 'GOLD_combined_nc_to_obs_nml', iunit) +read(iunit, nml = GOLD_combined_nc_to_obs_nml, iostat = rcio) +call check_namelist_read(iunit, rcio, 'GOLD_combined_nc_to_obs_nml') + +!print*,gold_netcdf_file + +! put the reference date into DART format +call set_calendar_type(GREGORIAN) + +first_obs = .true. + +call nc_check( nf90_open(gold_tdisk_netcdf_file, nf90_nowrite, ncid_tdisk), & + 'convert_gold_combined', 'opening file '//trim(gold_tdisk_netcdf_file) ) +call nc_check( nf90_open(gold_on2_netcdf_file, nf90_nowrite, ncid_on2), & + 'convert_gold_combined', 'opening file '//trim(gold_on2_netcdf_file) ) +call nc_check( nf90_open(gold_nemax_netcdf_file, nf90_nowrite, ncid_nemax), & + 'convert_gold_combined', 'opening file '//trim(gold_nemax_netcdf_file) ) + +call getdimlen(ncid_tdisk, "nlats", nlat_tdisk) +call getdimlen(ncid_tdisk, "nlons", nlon_tdisk) +call getdimlen(ncid_tdisk, "nscans", nscan_tdisk) +call getdimlen(ncid_tdisk, "max_string_len ", nmsl_tdisk) +call set_missing_name("missing_value") + +call getdimlen(ncid_on2, "nlats", nlat_on2) +call getdimlen(ncid_on2, "nlons", nlon_on2) +call getdimlen(ncid_on2, "nscans", nscan_on2) +call getdimlen(ncid_on2, "max_string_len ", nmsl_on2) +call set_missing_name("missing_value") + +call getdimlen(ncid_nemax, "nlats", nlat_nemax) +call getdimlen(ncid_nemax, "nlons", nlon_nemax) +call getdimlen(ncid_nemax, "nscans", nscan_nemax) +call getdimlen(ncid_nemax, "max_string_len ", nmsl_nemax) +call set_missing_name("missing_value") + +nobs_tdisk = nlat_tdisk * nlon_tdisk * nscan_tdisk +nobs_on2 = nlat_on2 * nlon_on2 * nscan_on2 +nobs_nemax = nlat_nemax * nlon_nemax * nscan_nemax +nvars = 1 +! Check meaning of nvars + +! Allocate arrays for tdisk +allocate( lat_tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( lon_tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_ran(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_sys(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +allocate( tdisk_unc_mod(nlon_tdisk,nlat_tdisk,nscan_tdisk)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_tdisk(24,nlon_tdisk,nlat_tdisk,nscan_tdisk)) + +! Allocate arrays for on2 +allocate( lat_on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( lon_on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_ran(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_sys(nlon_on2,nlat_on2,nscan_on2)) +allocate( on2_unc_mod(nlon_on2,nlat_on2,nscan_on2)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_on2(24,nlon_on2,nlat_on2,nscan_on2)) + +! Allocate arrays for nemax +allocate( lat_nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( lon_nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_ran(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_sys(nlon_nemax,nlat_nemax,nscan_nemax)) +allocate( nemax_unc_mod(nlon_nemax,nlat_nemax,nscan_nemax)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs_nemax(24,nlon_nemax,nscan_nemax)) + +! read in the data arrays for tdisk +call getvar_real_3d(ncid_tdisk, "latitude", lat_tdisk) ! latitudes +call getvar_real_3d(ncid_tdisk, "longitude", lon_tdisk) ! longitudes +call getvar_real_3d(ncid_tdisk, "tdisk", tdisk, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_ran", tdisk_unc_ran, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_sys", tdisk_unc_sys, tdisk_miss) ! maximum electron concentration +call getvar_real_3d(ncid_tdisk, "tdisk_unc_mod", tdisk_unc_mod, tdisk_miss) ! maximum electron concentration + +! read in the data arrays for on2 +call getvar_real_3d(ncid_on2, "latitude", lat_on2) ! latitudes +call getvar_real_3d(ncid_on2, "longitude", lon_on2) ! longitudes +call getvar_real_3d(ncid_on2, "on2", on2, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_ran", on2_unc_ran, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_sys", on2_unc_sys, on2_miss) ! maximum electron concentration +call getvar_real_3d(ncid_on2, "on2_unc_mod", on2_unc_mod, on2_miss) ! maximum electron concentration + +! read in the data arrays for nemax +call getvar_real_3d(ncid_nemax, "latitude", lat_nemax) ! latitudes +call getvar_real_3d(ncid_nemax, "longitude", lon_nemax) ! longitudes +call getvar_real_3d(ncid_nemax, "nmax", nemax, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_ran", nemax_unc_ran, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_sys", nemax_unc_sys, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid_nemax, "nmax_unc_mod", nemax_unc_mod, nemax_miss) ! maximum electron concentration + +! read the data for the time array tdisk +call nc_check( nf90_inq_varid(ncid_tdisk, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_tdisk, varid, tobs_tdisk, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon_tdisk, nlat_tdisk, nscan_tdisk /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +! read the data for the time array on2 +call nc_check( nf90_inq_varid(ncid_on2, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_on2, varid, tobs_on2, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon_on2, nlat_on2, nscan_on2 /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +! read the data for the time array nemax +call nc_check( nf90_inq_varid(ncid_nemax, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid_nemax, varid, tobs_nemax, & + start = (/ 1, 1, 1 /), count = (/ 24, nlon_nemax, nscan_nemax /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +call nc_check( nf90_close(ncid_tdisk), & + 'convert_gold_combined', 'closing file '//trim(gold_tdisk_netcdf_file) ) +call nc_check( nf90_close(ncid_on2), & + 'convert_gold_combined', 'closing file '//trim(gold_tdisk_netcdf_file) ) +call nc_check( nf90_close(ncid_on2), & + 'convert_gold_combined', 'closing file '//trim(gold_on2_netcdf_file) ) +call nc_check( nf90_close(ncid_nemax), & + 'convert_gold_combined', 'closing file '//trim(gold_nemax_netcdf_file) ) + +! either read existing obs_seq or create a new one +call static_init_obs_sequence() +call init_obs(obs, num_copies, num_qc) +call init_obs(prev_obs, num_copies, num_qc) + +inquire(file=gold_out_file, exist=file_exist) + +if ( file_exist ) then + + ! existing file found, append to it + call read_obs_seq(gold_out_file, 0, 0, nvars*(nobs_tdisk + nobs_on2 + nobs_nemax), obs_seq) + +else + + ! create a new one + call init_obs_sequence(obs_seq, num_copies, num_qc, nvars*(nobs_tdisk + nobs_on2 + nobs_nemax)) + do i = 1, num_copies + call set_copy_meta_data(obs_seq, i, 'GOLD observation') + end do + do i = 1, num_qc + call set_qc_meta_data(obs_seq, i, 'Data QC') + end do + +endif + +! Set the DART data quality control. Be consistent with NCEP codes; +! 0 is 'must use', 1 is good, no reason not to use it. +qc = 1.0_r8 + +year_obs = 1970 +month_obs = 1 +day_obs = 1 +hour_obs = 0 +minute_obs = 0 +second_obs = 0 + +nused = 0 +scanloop_tdisk: do k = 1, nscan_tdisk + lonloop_tdisk: do l = 1, nlon_tdisk + latloop_tdisk: do m = 1, nlat_tdisk + + if ('*' == tobs_tdisk(1,l,m,k)) cycle latloop_tdisk + do j = 1, 24 + tobs_string(j:j) = tobs_tdisk(j,l,m,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + if (.not. (lon_tdisk(l,m,k) < 180.0_r8 .and. lon_tdisk(l,m,k) > -180.0_r8)) cycle latloop_tdisk + if (.not. (lat_tdisk(l,m,k) < 90.0_r8 .and. lat_tdisk(l,m,k) > -90.0_r8)) cycle latloop_tdisk + + if ( lon_tdisk(l,m,k) < 0.0_r8 ) lon_tdisk(l,m,k) = lon_tdisk(l,m,k) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Fixed height of 150 km + height = 1.5E2 + + oerr = (tdisk_unc_ran(l,m,k)**2.0 + tdisk_unc_sys(l,m,k)**2.0)**0.5 + + if (not(isnan(tdisk(l,m,k)))) then + call create_3d_obs(lat_tdisk(l,m,k), lon_tdisk(l,m,k), height, VERTISHEIGHT, tdisk(l,m,k), & + GOLD_TEMPERATURE, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop_tdisk + end do lonloop_tdisk +end do scanloop_tdisk + +scanloop_on2: do k = 1, nscan_on2 + lonloop_on2: do l = 1, nlon_on2 + latloop_on2: do m = 1, nlat_on2 + + if ('*' == tobs_on2(1,l,m,k)) cycle latloop_on2 + do j = 1, 24 + tobs_string(j:j) = tobs_on2(j,l,m,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + if (.not. (lon_on2(l,m,k) < 180.0_r8 .and. lon_on2(l,m,k) > -180.0_r8)) cycle latloop_on2 + if (.not. (lat_on2(l,m,k) < 90.0_r8 .and. lat_on2(l,m,k) > -90.0_r8)) cycle latloop_on2 + + if ( lon_on2(l,m,k) < 0.0_r8 ) lon_on2(l,m,k) = lon_on2(l,m,k) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Not sure what to do about altitude coordinate, not included in GOLD file + pres = 5.0E-5 + + oerr = (on2_unc_ran(l,m,k)**2.0 + on2_unc_sys(l,m,k)**2.0)**0.5 + + if (not(isnan(on2(l,m,k)))) then + call create_3d_obs(lat_on2(l,m,k), lon_on2(l,m,k), pres, VERTISPRESSURE, on2(l,m,k), & + GOLD_ON2COLUMN, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop_on2 + end do lonloop_on2 +end do scanloop_on2 + +scanloop_nemax: do k = 1, nscan_nemax + lonloop_nemax: do l = 1, nlon_nemax + + if ('*' == tobs_nemax(1,l,k)) cycle lonloop_nemax + do j = 1, 24 + tobs_string(j:j) = tobs_nemax(j,l,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + latloop_nemax: do m = 1, nlat_nemax + + if (.not. (lon_nemax(l,m,k) < 180.0_r8 .and. lon_nemax(l,m,k) > -180.0_r8)) cycle latloop_nemax + if (.not. (lat_nemax(l,m,k) < 90.0_r8 .and. lat_nemax(l,m,k) > -90.0_r8)) cycle latloop_nemax + + if ( lon_nemax(l,m,k) < 0.0_r8 ) lon_nemax(l,m,k) = lon_nemax(l,m,k) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Not sure what to do about altitude coordinate, not included in GOLD file + pres = 5.0E-5 + + oerr = (nemax_unc_ran(l,m,k)**2.0 + nemax_unc_sys(l,m,k)**2.0)**0.5 + + if (not(isnan(nemax(l,m,k)))) then + call create_3d_obs(lat_nemax(l,m,k), lon_nemax(l,m,k), pres, VERTISPRESSURE, nemax(l,m,k), & + GOLD_NEMAX, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop_nemax + end do lonloop_nemax +end do scanloop_nemax + +100 continue + +print*,"Finished processing, about to write" + +! if we added any obs to the sequence, write it now. +if ( get_num_obs(obs_seq) > 0 ) call write_obs_seq(obs_seq, gold_out_file) + +! end of main program +call finalize_utilities() + + +end program convert_gold_combined + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ diff --git a/observations/GOLD/convert_gold_nemax.f90 b/observations/GOLD/convert_gold_nemax.f90 new file mode 100644 index 0000000000..45d92eb707 --- /dev/null +++ b/observations/GOLD/convert_gold_nemax.f90 @@ -0,0 +1,259 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! $Id$ + +program convert_gold_nemax + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! convert_gold_nmax - program that reads a GOLD netCDF NMAX +! observation file and writes a DART +! obs_seq file using the DART library routines. +! +! created Dec. 2007 Ryan Torn, NCAR/MMM (MADIS) +! modified Dec. 2008 Soyoung Ha and David Dowell, NCAR/MMM (MADIS) +! modified Jun. 2020 George Bowden, UNSW Canberra +! +! modified to use a common set of utilities, better netcdf error checks, +! able to insert obs with any time correctly (not only monotonically +! increasing times) nancy collins, ncar/image 11 march 2010 +! +! keep original obs times, make source for all converters as similar +! as possbile. nancy collins, ncar/image 26 march 2010 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +use types_mod, only : r8, missing_r8 +use location_mod, only : VERTISPRESSURE, VERTISHEIGHT, VERTISUNDEF +use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & + find_namelist_in_file, check_namelist_read +use time_manager_mod, only : time_type, set_calendar_type, set_date, operator(>=), & + increment_time, get_time, operator(-), GREGORIAN +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, write_obs_seq, & + init_obs_sequence, get_num_obs, & + set_copy_meta_data, set_qc_meta_data + +use obs_kind_mod, only : GOLD_NEMAX +use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, & + getvar_real_3d, & + create_3d_obs, getvar_int, getdimlen, set_missing_name + +use netcdf + +implicit none + +!character(len=13), parameter :: gold_netcdf_file = 'gold_input.nc' +!character(len=129), parameter :: gold_out_file = 'obs_seq.gold' + +! things which can/should be in the nc_to_obs_nml +character(len=128) :: gold_netcdf_file = 'gold_input.nc' +character(len=128) :: gold_out_file = 'obs_seq.gold' +logical :: debug = .true. + +namelist /GOLD_nemax_nc_to_obs_nml/ & + gold_netcdf_file, & + gold_out_file, & + debug + +logical, parameter :: use_input_qc = .true. + +integer, parameter :: num_copies = 1, & ! number of copies in sequence + num_qc = 1 ! number of QC entries + +integer :: ncid, nvars +integer :: i, oday, osec, nused, iunit, rcio +integer :: nobs, nlat, nlon, nscan, nmsl +integer :: k, l, m, n, j +integer :: varid + +logical :: file_exist, first_obs + +real(r8) :: pres, height, qc, qerr, oerr, nemax_miss + +integer :: year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs + +character, allocatable :: tobs(:,:,:) +real(r8), allocatable :: lat(:,:,:), lon(:,:,:) +real(r8), allocatable :: nemax(:,:,:), nemax_unc_ran(:,:,:), & + nemax_unc_sys(:,:,:), nemax_unc_mod(:,:,:) + +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, prev_time + +character(len = 8), parameter :: varname_time_utc = 'time_utc' +character(len = 24) :: tobs_string = '1970-01-01T00:00:00.000Z' + + +call initialize_utilities('convert_gold_nemax') + +! Read the DART namelist for this model +call find_namelist_in_file('input.nml', 'GOLD_nemax_nc_to_obs_nml', iunit) +read(iunit, nml = GOLD_nemax_nc_to_obs_nml, iostat = rcio) +call check_namelist_read(iunit, rcio, 'GOLD_nemax_nc_to_obs_nml') + +!print*,gold_netcdf_file + +! put the reference date into DART format +call set_calendar_type(GREGORIAN) + +first_obs = .true. + +call nc_check( nf90_open(gold_netcdf_file, nf90_nowrite, ncid), & + 'convert_gold_nemax', 'opening file '//trim(gold_netcdf_file) ) + +call getdimlen(ncid, "nlats", nlat) +call getdimlen(ncid, "nlons", nlon) +call getdimlen(ncid, "nscans", nscan) +call getdimlen(ncid, "max_string_len ", nmsl) +call set_missing_name("missing_value") + +!print*,"nlat = ",nlat +!print*,"nlon = ",nlon +!print*,"nscan = ",nscan +!print*,"nmsl = ",nmsl + +nobs = nlat * nlon * nscan +nvars = 1 + +!allocate( lat(nobs)) ; allocate( lon(nobs)) +!allocate( nemax(nobs)) ; allocate( nemax_unc_ran(nobs)) +!allocate( nemax_unc_sys(nobs)) ; allocate( nemax_unc_mod(nobs)) +!allocate( tobs(nmsl * nlon * nscan)) + +allocate( lat(nlon,nlat,nscan)) +allocate( lon(nlon,nlat,nscan)) +allocate( nemax(nlon,nlat,nscan)) +allocate( nemax_unc_ran(nlon,nlat,nscan)) +allocate( nemax_unc_sys(nlon,nlat,nscan)) +allocate( nemax_unc_mod(nlon,nlat,nscan)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs(24,nlon,nscan)) + +! read in the data arrays +call getvar_real_3d(ncid, "latitude", lat) ! latitudes +call getvar_real_3d(ncid, "longitude", lon) ! longitudes +call getvar_real_3d(ncid, "nmax", nemax, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid, "nmax_unc_ran", nemax_unc_ran, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid, "nmax_unc_sys", nemax_unc_sys, nemax_miss) ! maximum electron concentration +call getvar_real_3d(ncid, "nmax_unc_mod", nemax_unc_mod, nemax_miss) ! maximum electron concentration + +! read the data for the time array +call nc_check( nf90_inq_varid(ncid, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +!call nc_check( nf90_get_var(ncid, varid, tobs), & +! 'getvar_char', 'getting var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid, varid, tobs, & + start = (/ 1, 1, 1 /), count = (/ 24, nlon, nscan /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +call nc_check( nf90_close(ncid), & + 'convert_gold_nemax', 'closing file '//trim(gold_netcdf_file) ) + +! either read existing obs_seq or create a new one +call static_init_obs_sequence() +call init_obs(obs, num_copies, num_qc) +call init_obs(prev_obs, num_copies, num_qc) + +inquire(file=gold_out_file, exist=file_exist) + +if ( file_exist ) then + + ! existing file found, append to it + call read_obs_seq(gold_out_file, 0, 0, nvars*nobs, obs_seq) + +else + + ! create a new one + call init_obs_sequence(obs_seq, num_copies, num_qc, nvars*nobs) + do i = 1, num_copies + call set_copy_meta_data(obs_seq, i, 'GOLD observation') + end do + do i = 1, num_qc + call set_qc_meta_data(obs_seq, i, 'Data QC') + end do + +endif + +! Set the DART data quality control. Be consistent with NCEP codes; +! 0 is 'must use', 1 is good, no reason not to use it. +qc = 1.0_r8 + +year_obs = 1970 +month_obs = 1 +day_obs = 1 +hour_obs = 0 +minute_obs = 0 +second_obs = 0 + +nused = 0 +scanloop: do k = 1, nscan + lonloop: do l = 1, nlon + + if ('*' == tobs(1,l,k)) cycle lonloop + do j = 1, 24 + tobs_string(j:j) = tobs(j,l,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + latloop: do m = 1, nlat + + !if (.not. (lon(l,m,k) < 180.0_r8 .and. lon(l,m,k) > -180.0_r8)) cycle latloop + !if (.not. (lat(l,m,k) < 90.0_r8 .and. lat(l,m,k) > -90.0_r8)) cycle latloop + + if ( lon(l,m,k) < 0.0_r8 ) lon(l,m,k) = lon(l,m,k) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Not sure what to do about altitude coordinate, not included in GOLD file + !pres = 5.0E-5 + ! Fixed height of 150 km + height = 1.5E5 + + !oerr = (nemax_unc_ran(l,m,k)**2.0 + nemax_unc_sys(l,m,k)**2.0 + nemax_unc_mod(l,m,k)**2.0)**0.5 + oerr = (nemax_unc_ran(l,m,k)**2.0 + nemax_unc_sys(l,m,k)**2.0)**0.5 + !oerr = nemax_unc_ran(l,m,k) + + !if (not(isnan(nemax(l,m,k)))) then + if ((not(isnan(nemax(l,m,k)))) .and. (not(isnan(oerr)))) then + !call create_3d_obs(lat(l,m,k), lon(l,m,k), pres, VERTISPRESSURE, nemax(l,m,k), & + ! GOLD_NEMAX, oerr, oday, osec, qc, obs) + call create_3d_obs(lat(l,m,k), lon(l,m,k), height, VERTISUNDEF, nemax(l,m,k), & + GOLD_NEMAX, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop + end do lonloop +end do scanloop + +100 continue + +print*,"Finished processing, about to write" + +! if we added any obs to the sequence, write it now. +if ( get_num_obs(obs_seq) > 0 ) call write_obs_seq(obs_seq, gold_out_file) + +! end of main program +call finalize_utilities() + + +end program convert_gold_nemax + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ diff --git a/observations/GOLD/convert_gold_on2.f90 b/observations/GOLD/convert_gold_on2.f90 new file mode 100644 index 0000000000..761a4f9ac7 --- /dev/null +++ b/observations/GOLD/convert_gold_on2.f90 @@ -0,0 +1,247 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! $Id$ + +program convert_gold_on2 + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! convert_gold_nmax - program that reads a GOLD netCDF O/N2 +! observation file and writes a DART +! obs_seq file using the DART library routines. +! +! created Dec. 2007 Ryan Torn, NCAR/MMM (MADIS) +! modified Dec. 2008 Soyoung Ha and David Dowell, NCAR/MMM (MADIS) +! modified Jun. 2020 George Bowden, UNSW Canberra +! +! modified to use a common set of utilities, better netcdf error checks, +! able to insert obs with any time correctly (not only monotonically +! increasing times) nancy collins, ncar/image 11 march 2010 +! +! keep original obs times, make source for all converters as similar +! as possbile. nancy collins, ncar/image 26 march 2010 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +use types_mod, only : r8, missing_r8 +use location_mod, only : VERTISPRESSURE, VERTISHEIGHT, VERTISUNDEF +use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & + find_namelist_in_file, check_namelist_read +use time_manager_mod, only : time_type, set_calendar_type, set_date, operator(>=), & + increment_time, get_time, operator(-), GREGORIAN +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, write_obs_seq, & + init_obs_sequence, get_num_obs, & + set_copy_meta_data, set_qc_meta_data + +use obs_kind_mod, only : GOLD_ON2COLUMN +use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, & + getvar_real_3d, getvar_real_2d, & + create_3d_obs, getvar_int, getdimlen, set_missing_name + +use netcdf + +implicit none + +!character(len=13), parameter :: gold_netcdf_file = 'gold_input.nc' +!character(len=129), parameter :: gold_out_file = 'obs_seq.gold' + +! things which can/should be in the nc_to_obs_nml +character(len=128) :: gold_netcdf_file = 'gold_input.nc' +character(len=128) :: gold_out_file = 'obs_seq.gold' +logical :: debug = .true. + +namelist /GOLD_on2_nc_to_obs_nml/ & + gold_netcdf_file, & + gold_out_file, & + debug + +logical, parameter :: use_input_qc = .true. + +integer, parameter :: num_copies = 1, & ! number of copies in sequence + num_qc = 1 ! number of QC entries + +integer :: ncid, nvars +integer :: i, oday, osec, nused, iunit, rcio +integer :: nobs, nlat, nlon, nscan, nmsl +integer :: k, l, m, n, j +integer :: varid + +logical :: file_exist, first_obs + +real(r8) :: pres, height, qc, qerr, oerr, on2_miss + +integer :: year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs + +character, allocatable :: tobs(:,:,:,:) +real(r8), allocatable :: lat(:,:), lon(:,:) +real(r8), allocatable :: on2(:,:,:), on2_unc_ran(:,:,:), & + on2_unc_sys(:,:,:), on2_unc_mod(:,:,:) + +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, prev_time + +character(len = 8), parameter :: varname_time_utc = 'time_utc' +character(len = 24) :: tobs_string = '1970-01-01T00:00:00.000Z' + + +call initialize_utilities('convert_gold_on2') + +! Read the DART namelist for this model +call find_namelist_in_file('input.nml', 'GOLD_on2_nc_to_obs_nml', iunit) +read(iunit, nml = GOLD_on2_nc_to_obs_nml, iostat = rcio) +call check_namelist_read(iunit, rcio, 'GOLD_on2_nc_to_obs_nml') + +!print*,gold_netcdf_file + +! put the reference date into DART format +call set_calendar_type(GREGORIAN) + +first_obs = .true. + +call nc_check( nf90_open(gold_netcdf_file, nf90_nowrite, ncid), & + 'convert_gold_on2', 'opening file '//trim(gold_netcdf_file) ) + +call getdimlen(ncid, "nlats", nlat) +call getdimlen(ncid, "nlons", nlon) +call getdimlen(ncid, "nscans", nscan) +call getdimlen(ncid, "max_string_len ", nmsl) +call set_missing_name("missing_value") + +nobs = nlat * nlon * nscan +nvars = 1 + +allocate( lat(nlon,nlat)) +allocate( lon(nlon,nlat)) +allocate( on2(nlon,nlat,nscan)) +allocate( on2_unc_ran(nlon,nlat,nscan)) +allocate( on2_unc_sys(nlon,nlat,nscan)) +allocate( on2_unc_mod(nlon,nlat,nscan)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs(24,nlon,nlat,nscan)) + +! read in the data arrays +call getvar_real_2d(ncid, "latitude", lat) ! latitudes +call getvar_real_2d(ncid, "longitude", lon) ! longitudes +call getvar_real_3d(ncid, "on2", on2, on2_miss) ! Column O/N2 +call getvar_real_3d(ncid, "on2_unc_ran", on2_unc_ran, on2_miss) ! Column O/N2 random uncertainty +call getvar_real_3d(ncid, "on2_unc_sys", on2_unc_sys, on2_miss) ! Column O/N2 systematic uncertainty +call getvar_real_3d(ncid, "on2_unc_mod", on2_unc_mod, on2_miss) ! Column O/N2 model uncertainty + +! read the data for the time array +call nc_check( nf90_inq_varid(ncid, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +!call nc_check( nf90_get_var(ncid, varid, tobs), & +! 'getvar_char', 'getting var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid, varid, tobs, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon, nlat, nscan /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +call nc_check( nf90_close(ncid), & + 'convert_gold_on2', 'closing file '//trim(gold_netcdf_file) ) + +! either read existing obs_seq or create a new one +call static_init_obs_sequence() +call init_obs(obs, num_copies, num_qc) +call init_obs(prev_obs, num_copies, num_qc) + +inquire(file=gold_out_file, exist=file_exist) + +if ( file_exist ) then + + ! existing file found, append to it + call read_obs_seq(gold_out_file, 0, 0, nvars*nobs, obs_seq) + +else + + ! create a new one + call init_obs_sequence(obs_seq, num_copies, num_qc, nvars*nobs) + do i = 1, num_copies + call set_copy_meta_data(obs_seq, i, 'GOLD observation') + end do + do i = 1, num_qc + call set_qc_meta_data(obs_seq, i, 'Data QC') + end do + +endif + +! Set the DART data quality control. Be consistent with NCEP codes; +! 0 is 'must use', 1 is good, no reason not to use it. +qc = 1.0_r8 + +year_obs = 1970 +month_obs = 1 +day_obs = 1 +hour_obs = 0 +minute_obs = 0 +second_obs = 0 + +nused = 0 +scanloop: do k = 1, nscan + lonloop: do l = 1, nlon + latloop: do m = 1, nlat + + if ('*' == tobs(1,l,m,k)) cycle latloop + do j = 1, 24 + tobs_string(j:j) = tobs(j,l,m,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + !if (.not. (lon(l,m) < 180.0_r8 .and. lon(l,m) > -180.0_r8)) cycle latloop + !if (.not. (lat(l,m) < 90.0_r8 .and. lat(l,m) > -90.0_r8)) cycle latloop + + if ( lon(l,m) < 0.0_r8 ) lon(l,m) = lon(l,m) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Not sure what to do about altitude coordinate, not included in GOLD file + !pres = 5.0E-5 + ! Fixed height of 150 km + height = 1.5E5 + + !oerr = (on2_unc_ran(l,m,k)**2.0 + on2_unc_sys(l,m,k)**2.0 + on2_unc_mod(l,m,k)**2.0)**0.5 + oerr = (on2_unc_ran(l,m,k)**2.0 + on2_unc_sys(l,m,k)**2.0)**0.5 + !oerr = on2_unc_ran(l,m,k) + + if ((not(isnan(on2(l,m,k)))) .and. (not(isnan(oerr)))) then + !call create_3d_obs(lat(l,m,k), lon(l,m,k), pres, VERTISPRESSURE, on2(l,m,k), & + ! GOLD_ON2COLUMN, oerr, oday, osec, qc, obs) + call create_3d_obs(lat(l,m), lon(l,m), height, VERTISUNDEF, on2(l,m,k), & + GOLD_ON2COLUMN, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop + end do lonloop +end do scanloop + +100 continue + +print*,"Finished processing, about to write" + +! if we added any obs to the sequence, write it now. +if ( get_num_obs(obs_seq) > 0 ) call write_obs_seq(obs_seq, gold_out_file) + +! end of main program +call finalize_utilities() + + +end program convert_gold_on2 + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ diff --git a/observations/GOLD/convert_gold_tdisk.f90 b/observations/GOLD/convert_gold_tdisk.f90 new file mode 100644 index 0000000000..56885762af --- /dev/null +++ b/observations/GOLD/convert_gold_tdisk.f90 @@ -0,0 +1,244 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! $Id$ + +program convert_gold_tdisk + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! convert_gold_nmax - program that reads a GOLD netCDF TDISK +! observation file and writes a DART +! obs_seq file using the DART library routines. +! +! created Dec. 2007 Ryan Torn, NCAR/MMM (MADIS) +! modified Dec. 2008 Soyoung Ha and David Dowell, NCAR/MMM (MADIS) +! modified Jun. 2020 George Bowden, UNSW Canberra +! +! modified to use a common set of utilities, better netcdf error checks, +! able to insert obs with any time correctly (not only monotonically +! increasing times) nancy collins, ncar/image 11 march 2010 +! +! keep original obs times, make source for all converters as similar +! as possbile. nancy collins, ncar/image 26 march 2010 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +use types_mod, only : r8, missing_r8 +use location_mod, only : VERTISHEIGHT +use utilities_mod, only : nc_check, initialize_utilities, finalize_utilities, & + find_namelist_in_file, check_namelist_read +use time_manager_mod, only : time_type, set_calendar_type, set_date, operator(>=), & + increment_time, get_time, operator(-), GREGORIAN +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, write_obs_seq, & + init_obs_sequence, get_num_obs, & + set_copy_meta_data, set_qc_meta_data + +use obs_kind_mod, only : GOLD_TEMPERATURE +use obs_utilities_mod, only : getvar_real, get_or_fill_QC, add_obs_to_seq, & + getvar_real_3d, getvar_real_2d, & + create_3d_obs, getvar_int, getdimlen, set_missing_name + +use netcdf + +implicit none + +!character(len=13), parameter :: gold_netcdf_file = 'gold_input.nc' +!character(len=129), parameter :: gold_out_file = 'obs_seq.gold' + +! things which can/should be in the nc_to_obs_nml +character(len=128) :: gold_netcdf_file = 'gold_input.nc' +character(len=128) :: gold_out_file = 'obs_seq.gold' +logical :: debug = .true. + +namelist /GOLD_tdisk_nc_to_obs_nml/ & + gold_netcdf_file, & + gold_out_file, & + debug + +logical, parameter :: use_input_qc = .true. + +integer, parameter :: num_copies = 1, & ! number of copies in sequence + num_qc = 1 ! number of QC entries + +integer :: ncid, nvars +integer :: i, oday, osec, nused, iunit, rcio +integer :: nobs, nlat, nlon, nscan, nmsl +integer :: k, l, m, n, j +integer :: varid + +logical :: file_exist, first_obs + +real(r8) :: height, qc, qerr, oerr, tdisk_miss + +integer :: year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs + +character, allocatable :: tobs(:,:,:,:) +real(r8), allocatable :: lat(:,:), lon(:,:) +real(r8), allocatable :: tdisk(:,:,:), tdisk_unc_ran(:,:,:), & + tdisk_unc_sys(:,:,:), tdisk_unc_mod(:,:,:) + +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, prev_time + +character(len = 8), parameter :: varname_time_utc = 'time_utc' +character(len = 24) :: tobs_string = '1970-01-01T00:00:00.000Z' + + +call initialize_utilities('convert_gold_tdisk') + +! Read the DART namelist for this model +call find_namelist_in_file('input.nml', 'GOLD_tdisk_nc_to_obs_nml', iunit) +read(iunit, nml = GOLD_tdisk_nc_to_obs_nml, iostat = rcio) +call check_namelist_read(iunit, rcio, 'GOLD_tdisk_nc_to_obs_nml') + +!print*,gold_netcdf_file + +! put the reference date into DART format +call set_calendar_type(GREGORIAN) + +first_obs = .true. + +call nc_check( nf90_open(gold_netcdf_file, nf90_nowrite, ncid), & + 'convert_gold_tdisk', 'opening file '//trim(gold_netcdf_file) ) + +call getdimlen(ncid, "nlats", nlat) +call getdimlen(ncid, "nlons", nlon) +call getdimlen(ncid, "nscans", nscan) +call getdimlen(ncid, "max_string_len ", nmsl) +call set_missing_name("missing_value") + +nobs = nlat * nlon * nscan +nvars = 1 + +allocate( lat(nlon,nlat)) +allocate( lon(nlon,nlat)) +allocate( tdisk(nlon,nlat,nscan)) +allocate( tdisk_unc_ran(nlon,nlat,nscan)) +allocate( tdisk_unc_sys(nlon,nlat,nscan)) +allocate( tdisk_unc_mod(nlon,nlat,nscan)) +!allocate( tobs(nmsl,nlon,nscan)) +allocate( tobs(24,nlon,nlat,nscan)) + +! read in the data arrays +call getvar_real_2d(ncid, "latitude", lat) ! latitudes +call getvar_real_2d(ncid, "longitude", lon) ! longitudes +call getvar_real_3d(ncid, "tdisk", tdisk, tdisk_miss) ! Disk temperature +call getvar_real_3d(ncid, "tdisk_unc_ran", tdisk_unc_ran, tdisk_miss) ! Disk temperature random uncertainty +call getvar_real_3d(ncid, "tdisk_unc_sys", tdisk_unc_sys, tdisk_miss) ! Disk temperature systematic uncertainty +call getvar_real_3d(ncid, "tdisk_unc_mod", tdisk_unc_mod, tdisk_miss) ! Disk temperature model uncertainty + +! read the data for the time array +call nc_check( nf90_inq_varid(ncid, varname_time_utc, varid), & + 'getvar_char', 'inquire var '// trim(varname_time_utc)) +!call nc_check( nf90_get_var(ncid, varid, tobs), & +! 'getvar_char', 'getting var '// trim(varname_time_utc)) +call nc_check( nf90_get_var(ncid, varid, tobs, & + start = (/ 1, 1, 1, 1 /), count = (/ 24, nlon, nlat, nscan /)), & + 'getvar_char', 'getting var '// trim(varname_time_utc)) + +call nc_check( nf90_close(ncid), & + 'convert_gold_tdisk', 'closing file '//trim(gold_netcdf_file) ) + +! either read existing obs_seq or create a new one +call static_init_obs_sequence() +call init_obs(obs, num_copies, num_qc) +call init_obs(prev_obs, num_copies, num_qc) + +inquire(file=gold_out_file, exist=file_exist) + +if ( file_exist ) then + + ! existing file found, append to it + call read_obs_seq(gold_out_file, 0, 0, nvars*nobs, obs_seq) + +else + + ! create a new one + call init_obs_sequence(obs_seq, num_copies, num_qc, nvars*nobs) + do i = 1, num_copies + call set_copy_meta_data(obs_seq, i, 'GOLD observation') + end do + do i = 1, num_qc + call set_qc_meta_data(obs_seq, i, 'Data QC') + end do + +endif + +! Set the DART data quality control. Be consistent with NCEP codes; +! 0 is 'must use', 1 is good, no reason not to use it. +qc = 1.0_r8 + +year_obs = 1970 +month_obs = 1 +day_obs = 1 +hour_obs = 0 +minute_obs = 0 +second_obs = 0 + +nused = 0 +scanloop: do k = 1, nscan + lonloop: do l = 1, nlon + latloop: do m = 1, nlat + + if ('*' == tobs(1,l,m,k)) cycle latloop + do j = 1, 24 + tobs_string(j:j) = tobs(j,l,m,k) + end do + + read(tobs_string(1:4),*) year_obs + read(tobs_string(6:7),*) month_obs + read(tobs_string(9:10),*) day_obs + read(tobs_string(12:13),*) hour_obs + read(tobs_string(15:16),*) minute_obs + read(tobs_string(18:23),*) second_obs + + time_obs = set_date(year_obs, month_obs, day_obs, hour_obs, minute_obs, second_obs) + + !if (.not. (lon(l,m) < 180.0_r8 .and. lon(l,m) > -180.0_r8)) cycle latloop + !if (.not. (lat(l,m) < 90.0_r8 .and. lat(l,m) > -90.0_r8)) cycle latloop + + if ( lon(l,m) < 0.0_r8 ) lon(l,m) = lon(l,m) + 360.0_r8 + + ! extract actual time of observation in file into oday, osec. + call get_time(time_obs, osec, oday) + + ! Fixed height of 150 km + height = 1.5E5 + + !oerr = (tdisk_unc_ran(l,m,k)**2.0 + tdisk_unc_sys(l,m,k)**2.0 + tdisk_unc_mod(l,m,k)**2.0)**0.5 + !oerr = (tdisk_unc_ran(l,m,k)**2.0 + tdisk_unc_sys(l,m,k)**2.0)**0.5 + oerr = tdisk_unc_ran(l,m,k) + + !if (not(isnan(tdisk(l,m,k)))) then + if ((not(isnan(tdisk(l,m,k)))) .and. (not(isnan(oerr)))) then + call create_3d_obs(lat(l,m), lon(l,m), height, VERTISHEIGHT, tdisk(l,m,k), & + GOLD_TEMPERATURE, oerr, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + endif + + end do latloop + end do lonloop +end do scanloop + +100 continue + +print*,"Finished processing, about to write" + +! if we added any obs to the sequence, write it now. +if ( get_num_obs(obs_seq) > 0 ) call write_obs_seq(obs_seq, gold_out_file) + +! end of main program +call finalize_utilities() + + +end program convert_gold_tdisk + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ diff --git a/observations/GOLD/work/Makefile b/observations/GOLD/work/Makefile new file mode 100644 index 0000000000..f7ba5a6463 --- /dev/null +++ b/observations/GOLD/work/Makefile @@ -0,0 +1,77 @@ +# Makefile created by mkmf $Id$ + +include ../../../mkmf/mkmf.template + + +.DEFAULT: + -touch $@ +all: fixsys obs_sequence_tool +fixsys: + @ (cd ../../../mpi_utilities; ./fixsystem $(FC) ) +types_mod.o: ../../../common/types_mod.f90 + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../common/types_mod.f90 +random_seq_mod.o: ../../../random_seq/random_seq_mod.f90 types_mod.o utilities_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../random_seq/random_seq_mod.f90 +location_mod.o: ../../../location/oned/location_mod.f90 types_mod.o utilities_mod.o random_seq_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../location/oned/location_mod.f90 +obs_sequence_mod.o: ../../../obs_sequence/obs_sequence_mod.f90 types_mod.o location_mod.o obs_def_mod.o obs_kind_mod.o time_manager_mod.o utilities_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../obs_sequence/obs_sequence_mod.f90 +model_mod.o: ../../../models/lorenz_63/model_mod.f90 types_mod.o time_manager_mod.o location_mod.o utilities_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../models/lorenz_63/model_mod.f90 +cov_cutoff_mod.o: ../../../cov_cutoff/cov_cutoff_mod.f90 types_mod.o utilities_mod.o location_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../cov_cutoff/cov_cutoff_mod.f90 +obs_kind_mod.o: ../../../obs_kind/obs_kind_mod.f90 utilities_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../obs_kind/obs_kind_mod.f90 +assim_model_mod.o: ../../../assim_model/assim_model_mod.f90 types_mod.o location_mod.o time_manager_mod.o utilities_mod.o model_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../assim_model/assim_model_mod.f90 +obs_def_mod.o: ../../../obs_def/obs_def_mod.f90 types_mod.o utilities_mod.o location_mod.o assim_model_mod.o obs_kind_mod.o time_manager_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../obs_def/obs_def_mod.f90 +null_mpi_utilities_mod.o: ../../../mpi_utilities/null_mpi_utilities_mod.f90 types_mod.o utilities_mod.o time_manager_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../mpi_utilities/null_mpi_utilities_mod.f90 +time_manager_mod.o: ../../../time_manager/time_manager_mod.f90 types_mod.o utilities_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../time_manager/time_manager_mod.f90 +obs_sequence_tool.o: ../../../obs_sequence/obs_sequence_tool.f90 types_mod.o utilities_mod.o location_mod.o obs_def_mod.o obs_kind_mod.o time_manager_mod.o obs_sequence_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../obs_sequence/obs_sequence_tool.f90 +utilities_mod.o: ../../../utilities/utilities_mod.f90 types_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../utilities/utilities_mod.f90 +./cov_cutoff_mod.f90: ../../../cov_cutoff/cov_cutoff_mod.f90 + cp ../../../cov_cutoff/cov_cutoff_mod.f90 . +./obs_kind_mod.f90: ../../../obs_kind/obs_kind_mod.f90 + cp ../../../obs_kind/obs_kind_mod.f90 . +./obs_def_mod.f90: ../../../obs_def/obs_def_mod.f90 + cp ../../../obs_def/obs_def_mod.f90 . +./obs_sequence_mod.f90: ../../../obs_sequence/obs_sequence_mod.f90 + cp ../../../obs_sequence/obs_sequence_mod.f90 . +./types_mod.f90: ../../../common/types_mod.f90 + cp ../../../common/types_mod.f90 . +./location_mod.f90: ../../../location/oned/location_mod.f90 + cp ../../../location/oned/location_mod.f90 . +./utilities_mod.f90: ../../../utilities/utilities_mod.f90 + cp ../../../utilities/utilities_mod.f90 . +./time_manager_mod.f90: ../../../time_manager/time_manager_mod.f90 + cp ../../../time_manager/time_manager_mod.f90 . +./null_mpi_utilities_mod.f90: ../../../mpi_utilities/null_mpi_utilities_mod.f90 + cp ../../../mpi_utilities/null_mpi_utilities_mod.f90 . +./assim_model_mod.f90: ../../../assim_model/assim_model_mod.f90 + cp ../../../assim_model/assim_model_mod.f90 . +./random_seq_mod.f90: ../../../random_seq/random_seq_mod.f90 + cp ../../../random_seq/random_seq_mod.f90 . +./obs_sequence_tool.f90: ../../../obs_sequence/obs_sequence_tool.f90 + cp ../../../obs_sequence/obs_sequence_tool.f90 . +./model_mod.f90: ../../../models/lorenz_63/model_mod.f90 + cp ../../../models/lorenz_63/model_mod.f90 . +SRC = ../../../common/types_mod.f90 ../../../random_seq/random_seq_mod.f90 ../../../location/oned/location_mod.f90 ../../../obs_sequence/obs_sequence_mod.f90 ../../../models/lorenz_63/model_mod.f90 ../../../cov_cutoff/cov_cutoff_mod.f90 ../../../obs_kind/obs_kind_mod.f90 ../../../assim_model/assim_model_mod.f90 ../../../obs_def/obs_def_mod.f90 ../../../mpi_utilities/null_mpi_utilities_mod.f90 ../../../time_manager/time_manager_mod.f90 ../../../obs_sequence/obs_sequence_tool.f90 ../../../utilities/utilities_mod.f90 +OBJ = types_mod.o random_seq_mod.o location_mod.o obs_sequence_mod.o model_mod.o cov_cutoff_mod.o obs_kind_mod.o assim_model_mod.o obs_def_mod.o null_mpi_utilities_mod.o time_manager_mod.o obs_sequence_tool.o utilities_mod.o +OFF = ../../../cov_cutoff/cov_cutoff_mod.f90 ../../../obs_kind/obs_kind_mod.f90 ../../../obs_def/obs_def_mod.f90 ../../../obs_sequence/obs_sequence_mod.f90 ../../../common/types_mod.f90 ../../../location/oned/location_mod.f90 ../../../utilities/utilities_mod.f90 ../../../time_manager/time_manager_mod.f90 ../../../mpi_utilities/null_mpi_utilities_mod.f90 ../../../assim_model/assim_model_mod.f90 ../../../random_seq/random_seq_mod.f90 ../../../obs_sequence/obs_sequence_tool.f90 ../../../models/lorenz_63/model_mod.f90 +clean: neat + -rm -f .cppdefs $(OBJ) obs_sequence_tool +neat: + -rm -f $(TMPFILES) +localize: $(OFF) + cp $(OFF) . +TAGS: $(SRC) + etags $(SRC) +tags: $(SRC) + ctags $(SRC) +obs_sequence_tool: $(OBJ) + $(LD) $(OBJ) -o obs_sequence_tool $(LDFLAGS) diff --git a/observations/GOLD/work/dart_log.nml b/observations/GOLD/work/dart_log.nml new file mode 100644 index 0000000000..e9ef44a332 --- /dev/null +++ b/observations/GOLD/work/dart_log.nml @@ -0,0 +1,27107 @@ + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_combined + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + obs_seq.out.gold.on2 + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + , + FILENAME_OUT = obs_seq.out.gold.ostcom + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_combined + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + obs_seq.out.gold.on2 + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + , + FILENAME_OUT = obs_seq.out.gold.ostcom + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_combined + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_combined + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_combined + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + obs_seq.out.gold.on2 + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + , + FILENAME_OUT = obs_seq.out.gold.ostcom + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + obs_seq.out.gold.on2 + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + , + FILENAME_OUT = obs_seq.out.gold.ostcom + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + NUM_TASKS_INSENSITIVE = F, + MAINTAIN_ORIGINAL_VERT = F + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + + obs_seq.out.gold.on2 + + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + + , + FILENAME_OUT = obs_seq.out.gold.ostcom + + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + + obs_seq.out.gold.on2 + + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + + , + FILENAME_OUT = obs_seq.out.gold.ostcom + + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + + obs_seq.out.gold.on2 + + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + + , + FILENAME_OUT = obs_seq.out.gold.ostcom + + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + + obs_seq.out.gold.on2 + + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + + , + FILENAME_OUT = obs_seq.out.gold.ostcom + + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + + obs_seq.out.gold.on2 + + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + + , + FILENAME_OUT = obs_seq.out.gold.ostcom + + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program preprocess + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + !Finished Program preprocess + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_nemax + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_on2 + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program convert_gold_tdisk + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program + !Starting Program obs_sequence_tool + &UTILITIES_NML + TERMLEVEL = 2, + LOGFILENAME = dart_log.out + + , + MODULE_DETAILS = F, + NMLFILENAME = dart_log.nml + + , + PRINT_DEBUG = F, + WRITE_NML = file + / + &OBS_SEQUENCE_NML + WRITE_BINARY_OBS_SEQUENCE = F + / + &OBS_SEQUENCE_TOOL_NML + NUM_INPUT_FILES = 0, + FILENAME_SEQ = obs_seq.out.gold.nemax + + obs_seq.out.gold.on2 + + obs_seq.out.gold.tdisk + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + FILENAME_SEQ_LIST = + + , + FILENAME_OUT = obs_seq.out.gold.ostcom + + , + FIRST_OBS_DAYS = -1, + FIRST_OBS_SECONDS = -1, + LAST_OBS_DAYS = -1, + LAST_OBS_SECONDS = -1, + OBS_TYPES = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + KEEP_TYPES = T, + MIN_BOX = 4*-888888.000000000 , + MAX_BOX = 4*-888888.000000000 , + PRINT_ONLY = F, + MIN_LAT = -90.0000000000000 , + MAX_LAT = 90.0000000000000 , + MIN_LON = 0.000000000000000E+000, + MAX_LON = 360.000000000000 , + MIN_QC = -888888.000000000 , + MAX_QC = -888888.000000000 , + QC_METADATA = , + MIN_COPY = -888888.000000000 , + MAX_COPY = -888888.000000000 , + COPY_METADATA = , + COPY_TYPE = , + GREGORIAN_CAL = F, + MIN_GPS_HEIGHT = -888888.000000000 , + EDIT_COPY_METADATA = F, + NEW_COPY_INDEX = 256*-1, + EDIT_QC_METADATA = F, + NEW_QC_INDEX = 256*-1, + SYNONYMOUS_COPY_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + SYNONYMOUS_QC_LIST = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + EDIT_COPIES = F, + EDIT_QCS = F, + NEW_COPY_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_QC_METADATA = + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + , + NEW_COPY_DATA = 256*-888888.000000000 , + NEW_QC_DATA = 256*-888888.000000000 + / + &LOCATION_NML + HORIZ_DIST_ONLY = T, + VERT_NORMALIZATION_PRESSURE = 100000.000000000 , + VERT_NORMALIZATION_HEIGHT = 10000.0000000000 , + VERT_NORMALIZATION_LEVEL = 20.0000000000000 , + VERT_NORMALIZATION_SCALE_HEIGHT = 5.00000000000000 , + APPROXIMATE_DISTANCE = F, + NLON = 71, + NLAT = 36, + OUTPUT_BOX_INFO = F, + PRINT_BOX_LEVEL = 0, + MAINTAIN_ORIGINAL_VERT = F, + SPECIAL_VERT_NORMALIZATION_OBS_TYPES = null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null null null nu + ll null null null null + null null null null + null null null null + null null null null + null null null null + null null null null + null null , + SPECIAL_VERT_NORMALIZATION_PRESSURES = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_HEIGHTS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_LEVELS = 500*-888888.000000000 , + SPECIAL_VERT_NORMALIZATION_SCALE_HEIGHTS = 500*-888888.000000000 + / + !Finished Program diff --git a/observations/GOLD/work/input.nml b/observations/GOLD/work/input.nml new file mode 100644 index 0000000000..550cacad8a --- /dev/null +++ b/observations/GOLD/work/input.nml @@ -0,0 +1,59 @@ + +&preprocess_nml + input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90', + output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90', + input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90', + output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90', + input_files = '../../../obs_def/obs_def_GOLD_mod.f90', + / + +&obs_kind_nml + / + +&location_nml + / + +&utilities_nml + module_details = .false. + / + +&obs_sequence_nml + write_binary_obs_sequence = .false. + / + +&GOLD_nemax_nc_to_obs_nml + gold_netcdf_file = '/scratch/n23/gwb112/swm_project/GOLD_Data/2018/305/GOLD_L2_NMAX_2018_305_v01_r01_c01.nc' + gold_out_file = 'obs_seq.out.gold.nemax' + debug = .false. + / + +&GOLD_on2_nc_to_obs_nml + gold_netcdf_file = '/scratch/n23/gwb112/swm_project/GOLD_Data/2018/305/GOLD_L2_ON2_2018_305_v02_r01_c01.nc' + gold_out_file = 'obs_seq.out.gold.on2' + debug = .false. + / + +&GOLD_tdisk_nc_to_obs_nml + gold_netcdf_file = '/scratch/n23/gwb112/swm_project/GOLD_Data/2018/305/GOLD_L2_TDISK_2018_305_v02_r01_c01.nc' + gold_out_file = 'obs_seq.out.gold.tdisk' + debug = .false. + / + +&GOLD_combined_nc_to_obs_nml + gold_tdisk_netcdf_file = '/scratch/n23/gwb112/swm_project/GOLD_Data/2018/305/GOLD_L2_TDISK_2018_305_v02_r01_c01.nc' + gold_on2_netcdf_file = '/scratch/n23/gwb112/swm_project/GOLD_Data/2018/305/GOLD_L2_ON2_2018_305_v02_r01_c01.nc' + gold_nemax_netcdf_file = '/scratch/n23/gwb112/swm_project/GOLD_Data/2018/305/GOLD_L2_NMAX_2018_305_v01_r01_c01.nc' + gold_out_file = 'obs_seq.out.gold' + use_tdisk = .true. + use_on2 = .true. + use_nemax = .true. + debug = .false. + / + +&obs_sequence_tool_nml + filename_seq = 'obs_seq.out.gold.nemax', + 'obs_seq.out.gold.on2', + 'obs_seq.out.gold.tdisk', + filename_out = 'obs_seq.out.gold.ostcom', + gregorian_cal = .false. +/ \ No newline at end of file diff --git a/observations/GOLD/work/mkmf_convert_gold_combined b/observations/GOLD/work/mkmf_convert_gold_combined new file mode 100644 index 0000000000..1c73f8c351 --- /dev/null +++ b/observations/GOLD/work/mkmf_convert_gold_combined @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p convert_gold_combined -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_convert_gold_combined + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/GOLD/work/mkmf_convert_gold_nemax b/observations/GOLD/work/mkmf_convert_gold_nemax new file mode 100644 index 0000000000..b301d478cd --- /dev/null +++ b/observations/GOLD/work/mkmf_convert_gold_nemax @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p convert_gold_nemax -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_convert_gold_nemax + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/GOLD/work/mkmf_convert_gold_on2 b/observations/GOLD/work/mkmf_convert_gold_on2 new file mode 100644 index 0000000000..47908b3074 --- /dev/null +++ b/observations/GOLD/work/mkmf_convert_gold_on2 @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p convert_gold_on2 -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_convert_gold_on2 + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/GOLD/work/mkmf_convert_gold_tdisk b/observations/GOLD/work/mkmf_convert_gold_tdisk new file mode 100644 index 0000000000..ecaa011e17 --- /dev/null +++ b/observations/GOLD/work/mkmf_convert_gold_tdisk @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p convert_gold_tdisk -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_convert_gold_tdisk + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/GOLD/work/mkmf_obs_sequence_tool b/observations/GOLD/work/mkmf_obs_sequence_tool new file mode 100755 index 0000000000..60964dba07 --- /dev/null +++ b/observations/GOLD/work/mkmf_obs_sequence_tool @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p obs_sequence_tool -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_obs_sequence_tool + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/GOLD/work/mkmf_preprocess b/observations/GOLD/work/mkmf_preprocess new file mode 100755 index 0000000000..341dee439d --- /dev/null +++ b/observations/GOLD/work/mkmf_preprocess @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p preprocess -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_preprocess + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/GOLD/work/path_names_convert_gold_combined b/observations/GOLD/work/path_names_convert_gold_combined new file mode 100644 index 0000000000..567a09d277 --- /dev/null +++ b/observations/GOLD/work/path_names_convert_gold_combined @@ -0,0 +1,13 @@ +observations/GOLD/convert_gold_combined.f90 +observations/utilities/obs_utilities_mod.f90 +location/threed_sphere/location_mod.f90 +obs_sequence/obs_sequence_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_def/obs_def_mod.f90 +assim_model/assim_model_mod.f90 +models/template/model_mod.f90 +common/types_mod.f90 +random_seq/random_seq_mod.f90 +utilities/utilities_mod.f90 +time_manager/time_manager_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 diff --git a/observations/GOLD/work/path_names_convert_gold_nemax b/observations/GOLD/work/path_names_convert_gold_nemax new file mode 100644 index 0000000000..762605c6b5 --- /dev/null +++ b/observations/GOLD/work/path_names_convert_gold_nemax @@ -0,0 +1,13 @@ +observations/GOLD/convert_gold_nemax.f90 +observations/utilities/obs_utilities_mod.f90 +location/threed_sphere/location_mod.f90 +obs_sequence/obs_sequence_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_def/obs_def_mod.f90 +assim_model/assim_model_mod.f90 +models/template/model_mod.f90 +common/types_mod.f90 +random_seq/random_seq_mod.f90 +utilities/utilities_mod.f90 +time_manager/time_manager_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 diff --git a/observations/GOLD/work/path_names_convert_gold_on2 b/observations/GOLD/work/path_names_convert_gold_on2 new file mode 100644 index 0000000000..7a52ee7c0e --- /dev/null +++ b/observations/GOLD/work/path_names_convert_gold_on2 @@ -0,0 +1,13 @@ +observations/GOLD/convert_gold_on2.f90 +observations/utilities/obs_utilities_mod.f90 +location/threed_sphere/location_mod.f90 +obs_sequence/obs_sequence_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_def/obs_def_mod.f90 +assim_model/assim_model_mod.f90 +models/template/model_mod.f90 +common/types_mod.f90 +random_seq/random_seq_mod.f90 +utilities/utilities_mod.f90 +time_manager/time_manager_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 diff --git a/observations/GOLD/work/path_names_convert_gold_tdisk b/observations/GOLD/work/path_names_convert_gold_tdisk new file mode 100644 index 0000000000..8ecc02d5b9 --- /dev/null +++ b/observations/GOLD/work/path_names_convert_gold_tdisk @@ -0,0 +1,13 @@ +observations/GOLD/convert_gold_tdisk.f90 +observations/utilities/obs_utilities_mod.f90 +location/threed_sphere/location_mod.f90 +obs_sequence/obs_sequence_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_def/obs_def_mod.f90 +assim_model/assim_model_mod.f90 +models/template/model_mod.f90 +common/types_mod.f90 +random_seq/random_seq_mod.f90 +utilities/utilities_mod.f90 +time_manager/time_manager_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 diff --git a/observations/GOLD/work/path_names_obs_sequence_tool b/observations/GOLD/work/path_names_obs_sequence_tool new file mode 100644 index 0000000000..9c310c23e5 --- /dev/null +++ b/observations/GOLD/work/path_names_obs_sequence_tool @@ -0,0 +1,13 @@ +assim_model/assim_model_mod.f90 +common/types_mod.f90 +cov_cutoff/cov_cutoff_mod.f90 +location/oned/location_mod.f90 +models/lorenz_63/model_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +obs_def/obs_def_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_sequence/obs_sequence_mod.f90 +obs_sequence/obs_sequence_tool.f90 +random_seq/random_seq_mod.f90 +time_manager/time_manager_mod.f90 +utilities/utilities_mod.f90 diff --git a/observations/GOLD/work/path_names_preprocess b/observations/GOLD/work/path_names_preprocess new file mode 100644 index 0000000000..049487695a --- /dev/null +++ b/observations/GOLD/work/path_names_preprocess @@ -0,0 +1,5 @@ +preprocess/preprocess.f90 +common/types_mod.f90 +utilities/utilities_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +time_manager/time_manager_mod.f90 diff --git a/observations/GOLD/work/quickbuild.csh b/observations/GOLD/work/quickbuild.csh new file mode 100755 index 0000000000..8543cbd94e --- /dev/null +++ b/observations/GOLD/work/quickbuild.csh @@ -0,0 +1,69 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ +# +# compile all converter programs + +#---------------------------------------------------------------------- +# 'preprocess' is a program that culls the appropriate sections of the +# observation module for the observations types in 'input.nml'; the +# resulting source file is used by all the remaining programs, +# so this MUST be run first. +#---------------------------------------------------------------------- + +\rm -f preprocess *.o *.mod +\rm -f ../../../obs_def/obs_def_mod.f90 +\rm -f ../../../obs_kind/obs_kind_mod.f90 + +set MODEL = "GOLD converters" + +@ n = 1 + +echo +echo +echo "---------------------------------------------------------------" +echo "${MODEL} build number ${n} is preprocess" + +csh mkmf_preprocess +make || exit $n + +./preprocess || exit 99 + +#---------------------------------------------------------------------- +# Build all the single-threaded targets +#---------------------------------------------------------------------- + +foreach TARGET ( mkmf_* ) + + set PROG = `echo $TARGET | sed -e 's#mkmf_##'` + + switch ( $TARGET ) + case mkmf_preprocess: + breaksw + default: + @ n = $n + 1 + echo + echo "---------------------------------------------------" + echo "${MODEL} build number ${n} is ${PROG}" + \rm -f ${PROG} + csh $TARGET || exit $n + make || exit $n + breaksw + endsw +end + +\rm -f *.o *.mod input.nml*_default + +echo "Success: All ${MODEL} programs compiled." + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/GPSPW/work/Makefile b/observations/GPSPW/work/Makefile new file mode 100644 index 0000000000..4c2337615f --- /dev/null +++ b/observations/GPSPW/work/Makefile @@ -0,0 +1,45 @@ +# Makefile created by mkmf $Id$ + +include ../../../mkmf/mkmf.template + + +.DEFAULT: + -touch $@ +all: fixsys preprocess +fixsys: + @ (cd ../../../mpi_utilities; ./fixsystem $(FC) ) +time_manager_mod.o: ../../../time_manager/time_manager_mod.f90 types_mod.o utilities_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../time_manager/time_manager_mod.f90 +null_mpi_utilities_mod.o: ../../../mpi_utilities/null_mpi_utilities_mod.f90 types_mod.o utilities_mod.o time_manager_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../mpi_utilities/null_mpi_utilities_mod.f90 +preprocess.o: ../../../preprocess/preprocess.f90 utilities_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../preprocess/preprocess.f90 +utilities_mod.o: ../../../utilities/utilities_mod.f90 types_mod.o + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../utilities/utilities_mod.f90 +types_mod.o: ../../../common/types_mod.f90 + $(FC) $(FFLAGS) $(OTHERFLAGS) -c ../../../common/types_mod.f90 +./utilities_mod.f90: ../../../utilities/utilities_mod.f90 + cp ../../../utilities/utilities_mod.f90 . +./types_mod.f90: ../../../common/types_mod.f90 + cp ../../../common/types_mod.f90 . +./preprocess.f90: ../../../preprocess/preprocess.f90 + cp ../../../preprocess/preprocess.f90 . +./null_mpi_utilities_mod.f90: ../../../mpi_utilities/null_mpi_utilities_mod.f90 + cp ../../../mpi_utilities/null_mpi_utilities_mod.f90 . +./time_manager_mod.f90: ../../../time_manager/time_manager_mod.f90 + cp ../../../time_manager/time_manager_mod.f90 . +SRC = ../../../time_manager/time_manager_mod.f90 ../../../mpi_utilities/null_mpi_utilities_mod.f90 ../../../preprocess/preprocess.f90 ../../../utilities/utilities_mod.f90 ../../../common/types_mod.f90 +OBJ = time_manager_mod.o null_mpi_utilities_mod.o preprocess.o utilities_mod.o types_mod.o +OFF = ../../../utilities/utilities_mod.f90 ../../../common/types_mod.f90 ../../../preprocess/preprocess.f90 ../../../mpi_utilities/null_mpi_utilities_mod.f90 ../../../time_manager/time_manager_mod.f90 +clean: neat + -rm -f .cppdefs $(OBJ) preprocess +neat: + -rm -f $(TMPFILES) +localize: $(OFF) + cp $(OFF) . +TAGS: $(SRC) + etags $(SRC) +tags: $(SRC) + ctags $(SRC) +preprocess: $(OBJ) + $(LD) $(OBJ) -o preprocess $(LDFLAGS) diff --git a/observations/Madrigal/Madrigal.html b/observations/Madrigal/Madrigal.html new file mode 100644 index 0000000000..5fc87bfad4 --- /dev/null +++ b/observations/Madrigal/Madrigal.html @@ -0,0 +1,373 @@ + + + +DART observation converters from the CEDAR Archival Madrigal Database + + + + + + +

    PROGRAM TEC_to_obs

    + + + + + + +
    + DART project logo + +

    Jump to DART Documentation Main Index
    + version information for this file:
    + + $Id$
    +

    + +DATA SOURCES / +PROGRAMS / +NAMELIST / +REFERENCES / +ERRORS / +PLANS / +TERMS OF USE + +

    Overview

    + +

    World-wide Vertical Total Electron Content ASCII File to DART Observation Converter

    + +

    +The World-wide GPS Receiver Network Total Electron Content (TEC) observations from the +CEDAR Archival Madrigal Database +
    can be converted to DART observation sequence files with +TEC_text_to_obs. A DART observation 'KIND' of GPS_VTEC_EXTRAP +will be assigned to the observations. +

    +

    I am a big fan of giving credit where credit is due. Please read this quote from +the Madrigal home page: +

    +Use of the CEDAR Archival Madrigal Database is generally subject to the +CEDAR Rules-of-the-Road. Prior permission to access the data is not required. +However, the user is required to establish early contact with any organization +whose data are involved in the project to discuss the intended usage. Data are +often subject to limitations which are not immediately evident to new users. +Before they are formally submitted, draft copies of all reports and publications +must be sent to the contact scientist at all data-supplying organizations along +with an offer of co-authorship to scientists who have provided data. This offer +may be declined. The Database and the organizations that contributed data must +be acknowledged in all reports and publications, and whenever this data is +made available through another database. If you have any questions about +appropriate use of these data, contact brideout@haystack.mit.edu +
    +

    + + + + +
    [top]

    +

    DATA SOURCES

    + +

    +The TEC can be downloaded from +CEDAR Archival Madrigal Database +after a trivial registration. It is then important to be able to navigate to the proper +set of data. There are several methods of data download (Python, Matlab) - this document will simply outline the web interface method to download the data for a single day. +

    +
    1. From the Madrigal home page, choose the "Simple Local Data Access" option.
    2. +
    3. Choose "Distributed Ground Based Satellite Receivers" from the instrument types.
    4. +
    5. Choose "World-wide GPS Receiver Network [1998-2016]"
    6. +
    7. Pick your Year, Month, and Day from the subsequent calendar choices.
    8. +
    9. after a short wait, the Select File: menu will appear.
    10. +
    11. If you select "Print data", your screen should look something like:
    12. +
    +
    +Madrigal download screenshot +
    +
    + +

    This was the result of the "View info" menu:

    + +
    +
    +Catalog/Header information for gps050124g.002
    +
    +Catalog information from record 0:
    +
    +KRECC       2001 Catalogue Record, Version 1                                    
    +KINSTE      8000  World-wide GPS Receiver Network                               
    +MODEXP         1  Conversion to vertical TEC                                    
    +CMODEXP All Total electron content (TEC) measurements in this file are          
    +CMODEXP vertical TEC, where 1 TEC unit = 1E16 electrons per square meter.       
    +CMODEXP The conversion from the line-of-sight TEC values to vertical TEC        
    +CMODEXP are done by assuming a slab ionosphere at 350 km.  This means that      
    +CMODEXP only elevation needs to be considered in mapping line-of-sight TEC      
    +CMODEXP to vertical TEC.                                                        
    +CMODEXP                                                                         
    +CMODEXP Processing version 4.0 - Released May 13, 2009                          
    +CMODEXP   4.0 notes: New logic added to remove isolated tec data below          
    +CMODEXP              the TEC distribution median                                
    +CMODEXP   3.0 notes: Fixes scaling bug in version 2.0.                          
    +CMODEXP   2.0 notes:                                                            
    +CMODEXP   This all-python processing code includes more rigorous                
    +CMODEXP   error analysis, and uses Bayesian error analysis to                   
    +CMODEXP   better estimate TEC, which reduces the error.                         
    +CMODEXP                                                                         
    +CMODEXP More details are available from: http://www.haystack.mit.edu/           
    +C                                                                               
    +GGLAT1       -90 degrees. Lowest geographic latitude measured                   
    +GGLAT2        90 degrees. Highest geographic latitude measured                  
    +GGLON1         0 degrees. Westmost geographic longitude measured                
    +GGLON2       360 degrees. Eastmost geographic longitude measured                
    +IBYRE       2005 Beginning year                                                 
    +IBDTE       0124 Beginning month and day                                        
    +IBHME       0000 Beginning UT hour and minute                                   
    +IBCSE       0000 Beginning centisecond                                          
    +IEYRE       2005 Ending year                                                    
    +IEDTE       0125 Ending month and day                                           
    +IEHME       0000 Ending UT hour and minute                                      
    +IECSE       0000 Ending centisecond                                             
    +C                                                                               
    +CPI      A. Coster, B. Rideout                                                  
    +CPREPDAT 2009-06-17 10:17:37.828097                                             
    +
    +Header information from record 1:
    +
    +KRECH               3002 Header Record, Version 2                               
    +KINST          3    8000 World-wide GPS Receiver Network                        
    +KINDAT         4    3500 Minimum scalloping TEC processing                      
    +C                                                                               
    +IBYRT               2005 Beginning year                                         
    +IBDTT               0124 Beginning month and day                                
    +IBHMT               0000 Beginning UT hour and minute                           
    +IBCST               0000 Beginning centisecond                                  
    +IEYRT               2005 Ending year                                            
    +IEDTT               0125 Ending month and day                                   
    +IEHMT               0000 Ending UT hour and minute                              
    +IECST               0000 Ending centisecond                                     
    +LPROL         13      16 Length of prologue in data records                     
    +JPAR          14       0 Number of single-valued parameters                     
    +MPAR          15       3 Number of multiple-values parameters                   
    +C 2D Parameters:                                                                
    +KODM(1)       17     160 Geodetic latitude of measurement        1.0e-02     deg
    +KODM(2)              170 Geodetic longitude of measurement       1.0e-02     deg
    +KODM(3)              524 Vertically integrated electron density  1.0e-01     tec
    +KODM(4)             -524 Error in Vert integ electron density    1.0e-01     tec
    +CANALYST B. Rideout (brideout@haystack.mit.edu)                                 
    +CANDATE  2009-06-17 10:17:37.836526 
    +
    +
    + +

     

    + + + + +
    [top]

    +

    PROGRAMS

    + +

    TEC_text_to_obs.f90

    +

    +The TEC_text_to_obs.f90.f90 file is the source code +for the main converter program. +TEC_text_to_obs +reads each text line into a character buffer +and then reads from that buffer to parse up the data items. +

    + +

    The data format (apparently version 2) supported by the converter is:

    + + + + + + + + + + + + + + + +
    column   content
    1 YEAR
    2 MONTH
    3 DAY
    4 HOUR
    5 MINUTE
    6 SECOND
    7 UT1_UNIX (which DART ignores)
    8 UT2_UNIX (which DART ignores)
    9 RECNO (which DART ignores)
    10 Geodetic latitude of measurement - Units: deg
    11 Geographic longitude of measurement - Units: deg
    12 Vertically integrated electron density - Units: tec
    13 Error in Vertically integrated electron density - Units: tec
    +

    1 TEC unit = 1E16 electrons per square meter. +
    +
    +Since the provided Error (column 13) does not include "error of representativeness" (the mismatch between the instrument footprint and the model resolution), an assumption of an observation error variance of 25 has been used as in +(Chartier, 2016). Furthermore, a vertical location of 350km has been assigned to the observations to enable vertical localization if desired. +The observations will be DART KIND GPS_VTEC_EXTRAP. To assimilate +or evaluate these observations, GPS_VTEC_EXTRAP must appear in the +input.nml &obs_kind_nmlnamelist section +when running filter or perfect_model_obs. +

    + +

    obs_sequence_tool

    +

    +The obs_sequence/obs_sequence_tool.f90 may be used to combine multiple observation sequence files into a single file, etc. +See the obs_sequence_tool.html for details. +

    + +

    advance_time

    +

    +The time_manager/advance_time.f90 may also be +useful when scripting to set the time ranges. +See the advance_time.html for details. +

    + +

    Compiling and Testing

    +

    +To compile and test, go into the Madrigal/work subdirectory and +run the quickbuild.csh +script to build the converter and a couple of general purpose utilities. +The obs_sequence_tool +manipulates (i.e. combines, subsets) DART observation files once they have been created. +The default observations supported are those defined in +DART/obs_def/obs_def_upper_atm_mod.f90. +If you need additional observation types, you will have to add the +appropriate obs_def_XXX_mod.f90 file to the +input.nml &preprocess_nml:input_files +variable and run quickbuild.csh again. +It rebuilds the table of supported observation types before +compiling the source code. +

    + +

    +These instructions assume you have downloaded an ASCII file and put it +in the Madrigal/downloads directory. Running +shell_scripts/convert_day_by_day.csh +will automatically converting all the files in the +downloads directory to an equal number of DART observation +sequence files that have the YYYY_MM_DD as a suffix. +

    + +

     

    + + + + + + +
    [top]

    +

    NAMELIST

    +

    +This namelist is read from the file input.nml. +Namelists start with an ampersand +'&' and terminate with a slash '/'. +Character strings that contain a '/' must be +enclosed in quotes to prevent them from +prematurely terminating the namelist. +

    + +
    +
    +&TEC_text_to_obs_nml
    +   text_input_file  = "../downloads/gps050122g.002.txt"
    +   obs_out_base     = "obs_seq.out"
    +  /
    +
    +
    + +
    + +
    + + + + + + + + + + + + + + + + + + + + + +
    Contents Type Description
    text_input_filecharacter(len=256)The text file containing the raw observations for each site. +
    obs_out_basecharacter(len=256)The base portion of the output observation sequence file for DART. + This base will be appended with a ".YYYY_MM_DD" string that contains + the year, month, and day of the observations in the file. Since each + input file is a single day, this is easy. +
    + +
    + +

     

    + + + + + + +
    [top]

    +

    References

    +
      +
    • Chartier, A., T. Matsuo, J. L. Anderson, G. Lu, + T. Hoar, N. Collins, A. Coster, C. Mitchell, + L. Paxton, G. Bust (2016),
      +Ionospheric Data Assimilation and Forecasting During Storms.
      +Journal of Geophysical Research: Space Physics, 121, 764-778, +10.1002/2014JA020799 +
    • +
    + + + + + + +
    [top]

    +

    KNOWN BUGS

    +

    +none +

    + + + + + + +
    [top]

    +

    FUTURE PLANS

    +

    +none +

    + + + + + + +
    [top]

    +

    Terms of Use

    + +

    +DART software - Copyright 2004 - 2013 UCAR.
    +This open source software is provided by UCAR, "as is",
    +without charge, subject to all terms of use at
    + +http://www.image.ucar.edu/DAReS/DART/DART_download +

    + + + + + + + +
    Contact: Tim Hoar
    Revision: $Revision$
    Source: $URL$
    Change Date: $Date$
    Change history:  try "svn log" or "svn diff"
    + + + + + diff --git a/observations/Madrigal/Madrigal.png b/observations/Madrigal/Madrigal.png new file mode 100644 index 0000000000..49150b25a8 Binary files /dev/null and b/observations/Madrigal/Madrigal.png differ diff --git a/observations/Madrigal/TEC_text_to_obs.f90 b/observations/Madrigal/TEC_text_to_obs.f90 new file mode 100644 index 0000000000..503d381d98 --- /dev/null +++ b/observations/Madrigal/TEC_text_to_obs.f90 @@ -0,0 +1,288 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use a +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! DART $Id$ + +program TEC_text_to_obs + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! TEC_text_to_obs - reads fixed-format ASCII files from Madrigal +! http://madrigal.haystack.mit.edu/ +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +use types_mod, only : r8, PI, DEG2RAD, obstypelength + +use utilities_mod, only : initialize_utilities, finalize_utilities, to_upper, & + open_file, close_file, find_namelist_in_file, & + check_namelist_read, error_handler, E_MSG, E_ERR + +use time_manager_mod, only : time_type, set_calendar_type, GREGORIAN, & + set_date, set_time, get_time, print_date, & + operator(-), operator(+), operator(>=) + +use location_mod, only : VERTISHEIGHT + +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, write_obs_seq, & + init_obs_sequence, get_num_obs, & + set_copy_meta_data, set_qc_meta_data + +use obs_utilities_mod, only : create_3d_obs, add_obs_to_seq + +use obs_kind_mod, only : GPS_VTEC_EXTRAP + +implicit none + +! version controlled file description for error handling, do not edit +character(len=256), parameter :: source = & + "$URL$" +character(len=32 ), parameter :: revision = "$Revision$" +character(len=128), parameter :: revdate = "$Date$" + +! namelist variables + +character(len=256) :: text_input_file = 'gps050122g.002.txt' +character(len=256) :: obs_out_base = 'obs_seq.out' + +namelist /TEC_text_to_obs_nml/ & + text_input_file, & + obs_out_base + +! everbody else + +character(len=obstypelength) :: observation_type = 'GPS_VTEC_EXTRAP' + +character(len=256) :: obs_out_file +character(len=512) :: string1, string2 +character(len=1024) :: input_line + +integer :: oday, osec, rcio, iunit +integer :: iloc, num_missing +integer :: year, month, day, hour, minute, second +integer :: num_copies, num_qc, max_obs, linenum +integer :: observation_type_int + +logical :: first_obs + +real(r8) :: tec, tec_std, qc +real(r8) :: lat, lon + +!The error variance was chosen by Alex Chartier ... this includes +! observation error and error of representativeness. +real(r8), PARAMETER :: observation_error_variance = 25.0_r8 + +!variables to be discarded (only needed so that the read line works) +integer :: ignore_i + +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, prev_time + +! start of executable code + +call initialize_utilities('TEC_text_to_obs') + +! Read the DART namelist for this model +call find_namelist_in_file('input.nml', 'TEC_text_to_obs_nml', iunit) +read(iunit, nml = TEC_text_to_obs_nml, iostat = rcio) +call check_namelist_read(iunit, rcio, 'TEC_text_to_obs_nml') + +! Not really needed, but already here when imported from CHAMP ... +call set_observation_type() + +! time setup +call set_calendar_type(GREGORIAN) + +! open input text file +iunit = open_file(text_input_file, 'formatted', 'read') +write(string1,*) 'opened input file "' // trim(text_input_file) // '"' +write(string2,*) 'converting them as observation type '//trim(observation_type) + +call error_handler(E_MSG, 'TEC_text_to_obs', string1, & + source, revision, revdate, text2=string2) + +! each observation in this series will have a single observation value +! and a quality control flag. the max possible number of obs needs to +! be specified but it will only write out the actual number created. +max_obs = 2000000 +num_copies = 1 +num_qc = 1 + +! call the initialization code, and initialize two empty observation types +call static_init_obs_sequence() +call init_obs(obs, num_copies, num_qc) +call init_obs(prev_obs, num_copies, num_qc) +first_obs = .true. + +! create a new, empty obs_seq file. you must give a max limit +! on number of obs. increase the size if too small. +call init_obs_sequence(obs_seq, num_copies, num_qc, max_obs) + +! the first one needs to contain the string 'observation' and the +! second needs the string 'QC'. +call set_copy_meta_data(obs_seq, 1, 'observation') +call set_qc_meta_data(obs_seq, 1, 'Data QC') + +! Set the DART data quality control. 0 is good data. +! increasingly larger QC values are more questionable quality data. + +qc = 0.0_r8 + +! The first line is a description of the columns and units. +! As long as these are constant, we can skip them. +! column 01 * YEAR +! column 02 * MONTH +! column 03 * DAY +! column 04 * HOUR +! column 05 * MIN +! column 06 * SEC +! column 07 * UT1_UNIX (skipping) +! column 08 * UT2_UNIX (skipping) +! column 09 * RECNO (skipping) +! column 10 * GDLAT Geodetic latitude of measurement - Units: deg +! column 11 * GLON Geographic longitude of measurement - Units: deg +! column 12 * TEC Vertically integrated electron density - Units: tec +! column 13 * DTEC Error in Vertically integrated electron density - Units: tec +! +! 1 TEC unit = 1E16 electrons per square meter + +read(iunit,"(A)") input_line + +linenum = 1 +num_missing = 0 + +obsloop: do ! no end limit - have the loop break when input ends + + if (mod(linenum,100000) == 0) write(*,*)'Processing line ',linenum + + ! read in a line from the text file. What you need to create an obs: + ! location: lat, lon, and height in pressure or meters + ! time: when the observation was taken + ! type: from the DART list of obs types + ! error: very important - the instrument error plus representativeness error + ! (see html file for more info) + + ! read the whole line into a buffer and parse it later + read(iunit, "(A)", iostat=rcio) input_line + + if (rcio < 0) then + write(string1,*) trim(text_input_file)//' had ', linenum-1,' data lines.' + write(string2,*) 'of those, ',num_missing,' had "missing" values.' + call error_handler(E_MSG,'TEC_text_to_obs',string1, & + source, revision, revdate, text2=string2) + exit obsloop + endif + + if (rcio /= 0) then + write(string1,*) 'got bad read code (', rcio,') on line ',linenum + write(string2,*) 'of ',trim(text_input_file) + call error_handler(E_ERR,'TEC_text_to_obs',string1, & + source, revision, revdate, text2=string2) + endif + + linenum = linenum + 1 + + ! Some of the lines have 'missing' (as a character string). If this + ! is present - count them up, skip the line and cycle to the next line. + + iloc = index(input_line,'missing') + if (iloc /= 0) then + num_missing = num_missing + 1 + cycle obsloop + endif + + ! assumed format: + ! 1 2 3 4 5 6 7 8 9 10 11 12 13 + ! YEAR MONTH DAY HOUR MIN SEC UT1_UNIX UT2_UNIX RECNO GDLAT GLON TEC DTEC + + read(input_line, *, iostat=rcio) & + year, month, day, hour, minute, second, ignore_i, ignore_i, ignore_i, lat, lon, tec, tec_std + + if (rcio /= 0) then + write(string1,*) 'unable to parse line ',linenum + write(string2,*) 'of ',trim(text_input_file) + call error_handler(E_ERR,'TEC_text_to_obs',string1, & + source, revision, revdate, text2=string2) + endif + + ! if lon comes in between -180 and 180, use these lines instead: + if ( lat > 90.0_r8 ) lat = 90.0_r8 + if ( lat < -90.0_r8 ) lat = -90.0_r8 + if ( lon < 0.0_r8 ) lon = lon + 360.0_r8 + if ( lon >= 360.0_r8 ) lon = 0.0_r8 + + ! put date into a dart time format + + time_obs = set_date(year, month, day, hour, minute, second) + + ! extract time of observation into gregorian day, sec. + call get_time(time_obs, osec, oday) + + ! make an obs derived type, and then add it to the sequence + ! putting the observation at 350 km allows for vertical localization + ! DART location units for VERTISHEIGHT are meters. + + call create_3d_obs(lat, lon, 350000.0_r8, VERTISHEIGHT, tec, & + observation_type_int, observation_error_variance, oday, osec, qc, obs) + call add_obs_to_seq(obs_seq, obs, time_obs, prev_obs, prev_time, first_obs) + +end do obsloop + +! if we added any obs to the sequence, write it out to a file now. +! Since the files are in daily chunks, I am going to append the year/month/day +! to the output file base. Whatever is in the year/month/day variables should +! be correct. + +write(string1,'(''.'',i4.4,''_'',i2.2,''_'',i2.2)')year,month,day +write(obs_out_file,'(A)')trim(obs_out_base)//trim(string1) + +if ( get_num_obs(obs_seq) > 0 ) then + write(string1, *)'obs_count = ', get_num_obs(obs_seq) + call error_handler(E_MSG, 'TEC_text_to_obs', string1) + call write_obs_seq(obs_seq, obs_out_file) +else + call error_handler(E_MSG,'TEC_text_to_obs','no observations in sequence', & + source, revision, revdate) +endif + +! end of main program +call finalize_utilities() + +contains + +!----------------------------------------------------------------------- +!> + +subroutine set_observation_type + +! sets the global variable 'observation_type_int' based on the character +! string namelist input 'observation_type' + +character(len=obstypelength) :: observation_string + +! must create local copy because to_upper works in-place +observation_string = observation_type +call to_upper(observation_string) + +if (trim(observation_string) == 'GPS_VTEC_EXTRAP') then + observation_type_int = GPS_VTEC_EXTRAP +else + write(string1,*)'Unable to interpret observation string "'//trim(observation_type)//'"' + write(string2,*)'valid string is "GPS_VTEC_EXTRAP"' + call error_handler(E_ERR, 'TEC_text_to_obs', string1, & + source, revision, revdate, text2=string2) +endif + +end subroutine set_observation_type + + +end program TEC_text_to_obs + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ diff --git a/observations/Madrigal/TEC_text_to_obs.nml b/observations/Madrigal/TEC_text_to_obs.nml new file mode 100644 index 0000000000..84f685fdb0 --- /dev/null +++ b/observations/Madrigal/TEC_text_to_obs.nml @@ -0,0 +1,6 @@ + +&TEC_text_to_obs_nml + text_input_file = "../downloads/gps050122g.002.txt" + obs_out_base = "obs_seq.out" + / + diff --git a/observations/Madrigal/shell_scripts/convert_day_by_day.csh b/observations/Madrigal/shell_scripts/convert_day_by_day.csh new file mode 100755 index 0000000000..a0c0a92bd8 --- /dev/null +++ b/observations/Madrigal/shell_scripts/convert_day_by_day.csh @@ -0,0 +1,44 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +# Convert all the observation sequence files in the downloads directory. + +ls -1 ../downloads/gps* >! obstemp +sort obstemp | uniq >! file_list.txt + +# Simply loop over them, converting them one at a time +# The output filenames automatically get appended with the YYYY_MM_DD +# of the observations. + +set nfile = `cat file_list.txt | wc -l` +@ ifile = 1 +while ( $ifile <= $nfile ) + + set fname = `head -n $ifile file_list.txt | tail -n 1` + + sed -e "s#INPUT_FILENAME#${fname}#" input.nml.template >! input.nml + + echo "" + echo "converting ${fname}" + + ../work/TEC_text_to_obs || exit 1 + + @ ifile += 1 + +end + +# if all goes well, clean up +\rm -f obstemp file_list.txt input.nml dart_log.* + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/Madrigal/shell_scripts/input.nml.template b/observations/Madrigal/shell_scripts/input.nml.template new file mode 100644 index 0000000000..6c2f38514a --- /dev/null +++ b/observations/Madrigal/shell_scripts/input.nml.template @@ -0,0 +1,28 @@ + +&preprocess_nml + input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90' + output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90' + input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90' + output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90' + input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' + / + +&TEC_text_to_obs_nml + text_input_file = "INPUT_FILENAME" + obs_out_base = "obs_seq.out" + / + +&obs_kind_nml + / + +&location_nml + / + +&utilities_nml + module_details = .false. + / + +&obs_sequence_nml + write_binary_obs_sequence = .false. + / + diff --git a/observations/Madrigal/work/input.nml b/observations/Madrigal/work/input.nml new file mode 100644 index 0000000000..10333af748 --- /dev/null +++ b/observations/Madrigal/work/input.nml @@ -0,0 +1,28 @@ + +&preprocess_nml + input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90' + output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90' + input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90' + output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90' + input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' + / + +&TEC_text_to_obs_nml + text_input_file = "../downloads/gps050120g.002.txt" + obs_out_base = "obs_seq.out" + / + +&obs_kind_nml + / + +&location_nml + / + +&utilities_nml + module_details = .false. + / + +&obs_sequence_nml + write_binary_obs_sequence = .false. + / + diff --git a/observations/Madrigal/work/mkmf_TEC_text_to_obs b/observations/Madrigal/work/mkmf_TEC_text_to_obs new file mode 100755 index 0000000000..4de3a9e8a9 --- /dev/null +++ b/observations/Madrigal/work/mkmf_TEC_text_to_obs @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p TEC_text_to_obs -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_TEC_text_to_obs + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/Madrigal/work/mkmf_advance_time b/observations/Madrigal/work/mkmf_advance_time new file mode 100755 index 0000000000..d34f26048d --- /dev/null +++ b/observations/Madrigal/work/mkmf_advance_time @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p advance_time -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_advance_time + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/Madrigal/work/mkmf_obs_sequence_tool b/observations/Madrigal/work/mkmf_obs_sequence_tool new file mode 100755 index 0000000000..8ba988b160 --- /dev/null +++ b/observations/Madrigal/work/mkmf_obs_sequence_tool @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p obs_sequence_tool -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_obs_sequence_tool + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/Madrigal/work/mkmf_preprocess b/observations/Madrigal/work/mkmf_preprocess new file mode 100755 index 0000000000..e498b52d3d --- /dev/null +++ b/observations/Madrigal/work/mkmf_preprocess @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + +../../../mkmf/mkmf -p preprocess -t ../../../mkmf/mkmf.template \ + -a "../../.." path_names_preprocess + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/Madrigal/work/path_names_TEC_text_to_obs b/observations/Madrigal/work/path_names_TEC_text_to_obs new file mode 100644 index 0000000000..444e82e0b8 --- /dev/null +++ b/observations/Madrigal/work/path_names_TEC_text_to_obs @@ -0,0 +1,13 @@ +assim_model/assim_model_mod.f90 +common/types_mod.f90 +location/threed_sphere/location_mod.f90 +models/template/model_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +obs_def/obs_def_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_sequence/obs_sequence_mod.f90 +observations/Madrigal/TEC_text_to_obs.f90 +observations/utilities/obs_utilities_mod.f90 +random_seq/random_seq_mod.f90 +time_manager/time_manager_mod.f90 +utilities/utilities_mod.f90 diff --git a/observations/Madrigal/work/path_names_advance_time b/observations/Madrigal/work/path_names_advance_time new file mode 100644 index 0000000000..62fd921a9a --- /dev/null +++ b/observations/Madrigal/work/path_names_advance_time @@ -0,0 +1,6 @@ +common/types_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +time_manager/advance_time.f90 +time_manager/time_manager_mod.f90 +utilities/parse_args_mod.f90 +utilities/utilities_mod.f90 diff --git a/observations/Madrigal/work/path_names_obs_sequence_tool b/observations/Madrigal/work/path_names_obs_sequence_tool new file mode 100644 index 0000000000..535c3cb206 --- /dev/null +++ b/observations/Madrigal/work/path_names_obs_sequence_tool @@ -0,0 +1,12 @@ +assim_model/assim_model_mod.f90 +common/types_mod.f90 +location/threed_sphere/location_mod.f90 +models/template/model_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +obs_def/obs_def_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_sequence/obs_sequence_mod.f90 +obs_sequence/obs_sequence_tool.f90 +random_seq/random_seq_mod.f90 +time_manager/time_manager_mod.f90 +utilities/utilities_mod.f90 diff --git a/observations/Madrigal/work/path_names_preprocess b/observations/Madrigal/work/path_names_preprocess new file mode 100644 index 0000000000..38ecd5c4b2 --- /dev/null +++ b/observations/Madrigal/work/path_names_preprocess @@ -0,0 +1,5 @@ +common/types_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +preprocess/preprocess.f90 +time_manager/time_manager_mod.f90 +utilities/utilities_mod.f90 diff --git a/observations/Madrigal/work/quickbuild.csh b/observations/Madrigal/work/quickbuild.csh new file mode 100755 index 0000000000..2ccccca709 --- /dev/null +++ b/observations/Madrigal/work/quickbuild.csh @@ -0,0 +1,69 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ +# +# compile all Madrigal converter programs + +#---------------------------------------------------------------------- +# 'preprocess' is a program that culls the appropriate sections of the +# observation module for the observations types in 'input.nml'; the +# resulting source file is used by all the remaining programs, +# so this MUST be run first. +#---------------------------------------------------------------------- + +\rm -f preprocess *.o *.mod +\rm -f ../../../obs_def/obs_def_mod.f90 +\rm -f ../../../obs_kind/obs_kind_mod.f90 + +set MODEL = "Madrigal converters" + +@ n = 1 + +echo +echo +echo "---------------------------------------------------------------" +echo "${MODEL} build number ${n} is preprocess" + +csh mkmf_preprocess +make || exit $n + +./preprocess || exit 99 + +#---------------------------------------------------------------------- +# Build all the single-threaded targets +#---------------------------------------------------------------------- + +foreach TARGET ( mkmf_* ) + + set PROG = `echo $TARGET | sed -e 's#mkmf_##'` + + switch ( $TARGET ) + case mkmf_preprocess: + breaksw + default: + @ n = $n + 1 + echo + echo "---------------------------------------------------" + echo "${MODEL} build number ${n} is ${PROG}" + \rm -f ${PROG} + csh $TARGET || exit $n + make || exit $n + breaksw + endsw +end + +\rm -f *.o *.mod input.nml*_default + +echo "Success: All ${MODEL} programs compiled." + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/SSUSI/convert_f16_edr_dsk.html b/observations/SSUSI/convert_f16_edr_dsk.html index 0c114f3dee..f4a6f8bf94 100644 --- a/observations/SSUSI/convert_f16_edr_dsk.html +++ b/observations/SSUSI/convert_f16_edr_dsk.html @@ -109,6 +109,8 @@

    DATA SOURCES

    [top]

    PROGRAMS

    + +

    convert_f16_edr_dsk

    DART/observations/SSUSI/convert_f16_edr_dsk.f90 will extract ON2 data from the distribution files @@ -119,15 +121,26 @@

    PROGRAMS

    obs_sequence_tool utilities will be built.

    +

    netcdf_manip.csh

    An example data file is in the data directory. -An example scripts for adding the required metadata to the ON2_UNCERTAINTY -variable in the shell_scripts directory. -These are NOT intended to be turnkey scripts; they will -certainly need to be customized for your use. There are comments -at the top of the scripts saying what options they include, and -should be commented enough to indicate where changes will be -likely to need to be made. +SSUSI/shell_scripts/netcdf_manip.csh +will add the required metadata to the ON2_UNCERTAINTY +variables. +This is NOT intended to be a turnkey script; it will +certainly need to be customized for your use. The script is +internally commented. +

    + +

    create_obs_seq.csh

    +

    +SSUSI/shell_scripts/create_obs_seq.csh +will convert all the data files in the SSUSI/data +directory one-at-a-time, and then run obs_sequence_tool +to consolidate them into a single observation sequence file. The script +automatically invokes the NCO tools required to correct the metdata. +You will need to modify the script if you are not using the Unix 'modules' +environment.

    diff --git a/observations/SSUSI/shell_scripts/create_obs_seq.csh b/observations/SSUSI/shell_scripts/create_obs_seq.csh new file mode 100755 index 0000000000..fc1c8c34e6 --- /dev/null +++ b/observations/SSUSI/shell_scripts/create_obs_seq.csh @@ -0,0 +1,70 @@ +#!/bin/csh +# +# A script to produce multiple obs_seqs from the SSUSI files and combine them together +# +# DART software - Copyright 2004 - 2013 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# DART $Id$ + + +# The ON2_UNCERTAINTY variable in the netcdf files have IEEE NaN values, +# but none of the required metadata to interpret them correctly. +# These 2 lines will add the required attributes so that NaNs are replaced with +# a fill value that can be queried and checked for. +# Since the ON2_UNCERTAINTY is a standard deviation, it is enough to make it negative + +module load nco + +# The intent is to convert all the files in the data directory, one-by-one +# As we do that, we can create a list of those files and feed that list +# into obs_sequence_tool to consolidate them into a single observation sequence file. + +\rm file_list.txt + +# ensure the file names are as expected + +cp ../work/input.nml input.nml + +sed -i "s#input_netcdf_file .*#input_netcdf_file = 'netcdf_input.nc'#" input.nml +sed -i "s#output_obs_file .*#output_obs_file = 'obs_seq.out'#" input.nml +sed -i "s#filename_seq_list .*#filename_seq_list = 'file_list.txt'#" input.nml +sed -i "s#filename_seq .*#filename_seq = ''#" input.nml + +set i = 1 +foreach fname (`ls ../data/*.NC`) + + # ensure the netCDF metadata is correct + + ncatted -a _FillValue,ON2_UNCERTAINTY,o,f,NaN $fname + ncatted -a _FillValue,ON2_UNCERTAINTY,m,f,-1.0 $fname + + ln -sf $fname netcdf_input.nc + + ../work/convert_f16_edr_dsk || exit 1 + + # create a nice sequential output file name + set ofname = `printf obs_seq.out_%04d $i` + + mv obs_seq.out $ofname || exit 2 + + echo $ofname >> file_list.txt + + endif + @ i++ +end + +../work/obs_sequence_tool || exit 3 + +echo "Wrote to obs_seq.processed" + +\rm -f file_list.txt dart_log.* + +exit 0 + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/gps/convert_cosmic_gps_cdf.f90 b/observations/gps/convert_cosmic_gps_cdf.f90 index e855ccaf0f..17df931918 100644 --- a/observations/gps/convert_cosmic_gps_cdf.f90 +++ b/observations/gps/convert_cosmic_gps_cdf.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program convert_cosmic_gps_cdf @@ -43,10 +41,9 @@ program convert_cosmic_gps_cdf implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'convert_cosmic_gps_cdf.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' integer, parameter :: num_copies = 1, & ! number of copies in sequence @@ -1121,8 +1118,3 @@ end function compute_geopotential_height end program -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/observations/gps/convert_cosmic_gps_cdf.nml b/observations/gps/convert_cosmic_gps_cdf.nml index f61e33fe91..008fd6032e 100644 --- a/observations/gps/convert_cosmic_gps_cdf.nml +++ b/observations/gps/convert_cosmic_gps_cdf.nml @@ -1,11 +1,12 @@ &convert_cosmic_gps_nml - gpsro_netcdf_file = 'cosmic_gps_input.nc' - gpsro_netcdf_filelist = '' - gpsro_out_file = 'obs_seq.gpsro' - local_operator = .true. - use_original_kuo_error = .false. - ray_ds = 5000.0 - ray_htop = 15000.0 - obs_levels(nmaxlevels) = -1.0 - / + obs_levels = -1.0 + local_operator = .true. + use_original_kuo_error = .false. + gpsro_netcdf_file = 'cosmic_gps_input.nc' + gpsro_netcdf_filelist = '' + gpsro_out_file = 'obs_seq.gpsro' + ray_ds = 5000.0 + ray_htop = 15000.0 + / + diff --git a/observations/gps/convert_cosmic_iono_cdf.f90 b/observations/gps/convert_cosmic_iono_cdf.f90 new file mode 100644 index 0000000000..8add4f9351 --- /dev/null +++ b/observations/gps/convert_cosmic_iono_cdf.f90 @@ -0,0 +1,572 @@ +! DART software - Copyright 2004 - 2013 UCAR. This open source software is +! provided by UCAR, "as is", without charge, subject to all terms of use at +! http://www.image.ucar.edu/DAReS/DART/DART_download +! +! $Id$ + +!> a version of the netcdf -> dart obs_seq converter for ionosphere profiles +!> the file type from the CDAAC data site is 'ionPrf'. + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! convert_cosmic_gps_cdf - program that reads a COSMIC GPS observation +! profile and writes the data to a DART +! observation sequence file. +! +! created June 2008 Ryan Torn, NCAR/MMM +! modify Fab. 2010 I-TE LEE, NCAR/HAO & NCU +! Modify to read the ionPrf data file of COSMIC +! and write the data to the DART format. +! Oct. 2010 I-TE LEE, NCAR/HAO & NCU +! Remove the code for lower atmospheric observations +! Dec. 2010 I-TE LEE, NCAR/HAO & NCU +! Add new error valur for log scale testing +! Jan. 2011 I-TE LEE, NCAR/HAO & NCU +! Modify for real GOX observations +! Jan. 2011 I-TE LEE, NACR/HAO & NCU +! Add subroutine to calculate the observation varience +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +!export MALLOC_CHECK_=0 + +program convert_cosmic_iono_cdf + +use types_mod, only : r8, metadatalength +use time_manager_mod, only : time_type, set_calendar_type, GREGORIAN, set_time,& + increment_time, get_time, set_date, operator(-), & + print_date +use utilities_mod, only : initialize_utilities, find_namelist_in_file, & + check_namelist_read, nmlfileunit, do_nml_file, & + get_next_filename, error_handler, E_ERR, E_MSG, & + nc_check, find_textfile_dims, do_nml_term +use location_mod, only : VERTISHEIGHT, set_location +use obs_sequence_mod, only : obs_sequence_type, obs_type, read_obs_seq, & + static_init_obs_sequence, init_obs, destroy_obs, & + write_obs_seq, init_obs_sequence, get_num_obs, & + insert_obs_in_seq, destroy_obs_sequence, & + set_copy_meta_data, set_qc_meta_data, set_qc, & + set_obs_values, set_obs_def, insert_obs_in_seq +use obs_def_mod, only : obs_def_type, set_obs_def_time, set_obs_def_kind, & + set_obs_def_error_variance, set_obs_def_location, & + set_obs_def_key +use obs_kind_mod, only : GPS_PROFILE + +use netcdf + +implicit none + +! version controlled file description for error handling, do not edit +character(len=256), parameter :: source = & + "$URL$" +character(len=32 ), parameter :: revision = "$Revision$" +character(len=128), parameter :: revdate = "$Date$" +! +!Set the value equal to 0 for the OSSE testing, for real case it should be large then 1 +! +integer, parameter :: num_copies = 1, & ! number of copies in sequence + num_qc = 1 ! number of QC entries + +character (len=512) :: msgstring +character (len=256) :: next_infile +character (len=80) :: name +character (len=19) :: datestr +character (len=6) :: subset +integer :: ncid, varid, nlevels, k, nfiles, num_new_obs, & + aday, asec, dday, dsec, oday, osec, & + iyear, imonth, iday, ihour, imin, isec, & + zloc, obs_num, io, iunit, nobs, filenum, dummy +logical :: file_exist, first_obs, did_obs, from_list = .false. +real(r8) :: hght_miss, elec_miss, err, oerr, & + qc, lato, lono, hghto, eleco, wght, & + obsval, obs_val(1), qc_val(1) + + +real(r8), allocatable :: lat(:), lon(:), hght(:), elec(:), & + hghtp(:) +!add F3/C ionprf observation error /add by ITL 2011.01.31 +real(r8), dimension(15,37,25) :: f3coerr + +type(obs_def_type) :: obs_def +type(obs_sequence_type) :: obs_seq +type(obs_type) :: obs, prev_obs +type(time_type) :: time_obs, time_anal + +!------------------------------------------------------------------------ +! Declare namelist parameters +!------------------------------------------------------------------------ + +integer, parameter :: NMAXLEVELS = 20000 ! max number of observation levels + +!>@todo change overwrite_time default to .false. +logical :: overwrite_time = .true. !false. ! careful - see note below +real(r8) :: obs_levels(NMAXLEVELS) = -1.0_r8 +!real(r8) :: obs_window = 0.250 ! accept obs within +/- hours from anal time +real(r8) :: obs_window = 0.5 +character(len=256) :: input_file = '' +character(len=256) :: input_file_list = 'file_list.txt' +character(len=256) :: output_file = 'obs_seq.out' + +namelist /convert_cosmic_iono_nml/ obs_levels, obs_window, & + input_file, & + input_file_list, output_file + +! 'overwrite_time' replaces the actual observation times with the +! analysis time for all obs. this is intentionally not in the namelist +! because we think observations should preserve the original times in all +! cases. but one of our users had a special request to overwrite the time +! with the synoptic time, so there is code in this converter to do that +! if this option is set to .true. but we still don't encourage its use. + +! initialize some values +obs_num = 1 +qc = 0.0_r8 + +print*,'Enter the target assimilation time (yyyy-mm-dd_hh:mm:ss)' +read*,datestr + +call set_calendar_type(GREGORIAN) +read(datestr(1:4), fmt='(i4)') iyear +read(datestr(6:7), fmt='(i2)') imonth +read(datestr(9:10), fmt='(i2)') iday +read(datestr(12:13), fmt='(i2)') ihour + +read(datestr(15:16), fmt='(i2)') imin +read(datestr(18:19), fmt='(i2)') isec +time_anal = set_date(iyear, imonth, iday, ihour, imin, isec) +call get_time(time_anal, asec, aday) + +! read the necessary parameters from input.nml +call initialize_utilities() + +!call find_namelist_in_file("work/input.nml", "convert_cosmic_iono_nml", iunit) +call find_namelist_in_file("input.nml", "convert_cosmic_iono_nml", iunit) +read(iunit, nml = convert_cosmic_iono_nml, iostat = io) +call check_namelist_read(iunit, io, "convert_cosmic_iono_nml") + +! Record the namelist values used for the run +if (do_nml_file()) write(nmlfileunit, nml=convert_cosmic_iono_nml) +if (do_nml_term()) write( * , nml=convert_cosmic_iono_nml) + +! namelist checks for sanity + +! count observation levels, make sure observation levels increase from 0 +nlevels = 0 +do k = 1, NMAXLEVELS + if ( obs_levels(k) == -1.0_r8 ) exit + nlevels = k +end do +do k = 2, nlevels + if ( obs_levels(k-1) >= obs_levels(k) ) then + call error_handler(E_ERR, 'convert_cosmic_iono_cdf', & + 'Observation levels should increase', & + source, revision, revdate) + end if +end do + +! should error check the window some +if (obs_window <= 0.0_r8 .or. obs_window > 24.0_r8) then + call error_handler(E_ERR, 'convert_cosmic_iono_cdf', & + 'Bad value for obs_window (hours)', & + source, revision, revdate) +else + ! convert to seconds + obs_window = obs_window * 3600.0_r8 +endif + + +! cannot have both a single filename and a list; the namelist must +! shut one off. +if (input_file /= '' .and. input_file_list /= '') then + call error_handler(E_ERR, 'convert_cosmic_iono_cdf', & + 'One of input_file or input_file_list must be NULL', & + source, revision, revdate) +endif +if (input_file_list /= '') from_list = .true. + +! need to know a reasonable max number of obs that could be added here. +if (from_list) then + call find_textfile_dims(input_file_list, nfiles, dummy) + num_new_obs = nlevels * nfiles +else + num_new_obs = nlevels +endif + +! either read existing obs_seq or create a new one +call static_init_obs_sequence() +call init_obs(obs, num_copies, num_qc) +call init_obs(prev_obs, num_copies, num_qc) +inquire(file=output_file, exist=file_exist) +if ( file_exist ) then + +print *, "found existing obs_seq file, appending to ", trim(output_file) + call read_obs_seq(output_file, 0, 0, num_new_obs, obs_seq) + +else + + print *, "no existing obs_seq file, creating ", trim(output_file) + print *, "max entries = ", num_new_obs + call init_obs_sequence(obs_seq, num_copies, num_qc, num_new_obs) + do k = 1, num_copies + call set_copy_meta_data(obs_seq, k, 'observations') + end do + do k = 1, num_qc + call set_qc_meta_data(obs_seq, k, 'Ionprf QC') + end do + +end if + +!Reading ionprf observation error /add by ITL 2011.01.31 +!open(16,FILE='f3coerr.dat',STATUS='old',FORM='FORMATTED') +!read(16,*) f3coerr +open(16,FILE='obserr.dat',STATUS='old',FORM='FORMATTED') +read(16,*) f3coerr + +allocate(hghtp(nlevels)) ; +did_obs = .false. + +! main loop that does either a single file or a list of files + +filenum = 1 +fileloop: do ! until out of files + + ! get the single name, or the next name from a list + if (from_list) then + next_infile = get_next_filename(input_file_list, filenum) + else + next_infile = input_file + if (filenum > 1) next_infile = '' + endif + if (next_infile == '') exit fileloop + + ! open the occultation profile, check if it is within the window + call nc_check( nf90_open(next_infile, nf90_nowrite, ncid), 'file open', next_infile) + call nc_check( nf90_get_att(ncid,nf90_global,'year', iyear) ,'get_att year') + call nc_check( nf90_get_att(ncid,nf90_global,'month', imonth),'get_att month') + call nc_check( nf90_get_att(ncid,nf90_global,'day', iday) ,'get_att day') + call nc_check( nf90_get_att(ncid,nf90_global,'hour', ihour) ,'get_att hour') + call nc_check( nf90_get_att(ncid,nf90_global,'minute',imin) ,'get_att minute') + call nc_check( nf90_get_att(ncid,nf90_global,'second',isec) ,'get_att second') + + time_obs = set_date(iyear, imonth, iday, ihour, imin, isec) + call get_time(time_obs, osec, oday) + + !time1-time2 is always positive no matter the relative magnitudes + call get_time(time_anal-time_obs,dsec,dday) + if ( real(dsec+dday*86400) > obs_window ) then + call error_handler(E_MSG, 'convert_cosmic_iono_cdf: ', & + 'Input file '//trim(next_infile), & + source, revision, revdate) + write(msgstring, '(A,F8.4,A)') 'Ignored because obs time > ', & + obs_window / 3600.0, ' hours from analysis time' + call error_handler(E_MSG, '', msgstring, & + source, revision, revdate) + call print_date(time_obs, ' observation time: ') + call print_date(time_anal, ' window center time: ') + + filenum = filenum + 1 + cycle fileloop + end if + print *,next_infile + + call nc_check( nf90_inq_dimid(ncid, "MSL_alt", varid), 'inq dimid MSL_alt') + call nc_check( nf90_inquire_dimension(ncid, varid, name, nobs), 'inq dim MSL_alt') + print *,nobs + allocate( lat(nobs)) ; allocate( lon(nobs)) + allocate(hght(nobs)) ; allocate(elec(nobs)) + + ! read the latitude array + call nc_check( nf90_inq_varid(ncid, "GEO_lat", varid) ,'inq varid GEO_lat') + call nc_check( nf90_get_var(ncid, varid, lat) ,'get var GEO_lat') + + ! read the latitude array + call nc_check( nf90_inq_varid(ncid, "GEO_lon", varid) ,'inq varid GEO_lon') + call nc_check( nf90_get_var(ncid, varid, lon) ,'get var GEO_lon') + + ! read the altitude array + call nc_check( nf90_inq_varid(ncid, "MSL_alt", varid) ,'inq varid MSL_alt') + call nc_check( nf90_get_var(ncid, varid, hght) ,'get_var MSL_alt') + call nc_check( nf90_get_att(ncid, varid, '_FillValue', hght_miss) ,'get_att _FillValue MSL_alt') + + ! read the electorn density profiles (modify by ITL) + call nc_check( nf90_inq_varid(ncid, "ELEC_dens", varid) ,'inq varid ELEC_dens') + call nc_check( nf90_get_var(ncid, varid, elec) ,'get var ELEC_dens') + call nc_check( nf90_get_att(ncid, varid, '_FillValue', elec_miss) ,'get_att _FillValue Elec') + + !>todo support the _FillValue + + ! check for the data quality + if (maxval(elec) > 10000000) then + call error_handler(E_MSG, 'Bad convert_cosmic_iono_cdf: ', & + 'Input file '//trim(next_infile), & + source, revision, revdate) + deallocate( lat, lon, hght, elec ) + filenum = filenum + 1 + cycle fileloop + end if + + call nc_check( nf90_close(ncid) , 'close file') + + obsloop: do k = 1, nlevels + + call interp_height_wght(hght, obs_levels(k), nobs, zloc, wght) + if ( zloc < 1 ) cycle obsloop + hghtp(nlevels-k+1) = obs_levels(k) * 1000.0_r8 + + end do obsloop + + first_obs = .true. + + obsloop2: do k = 1, nlevels + + call interp_height_wght(hght, obs_levels(k), nobs, zloc, wght) + if ( zloc < 1 ) cycle obsloop2 + + lato = wght * lat(zloc) + (1.0_r8 - wght) * lat(zloc+1) + lono = wght * lon(zloc) + (1.0_r8 - wght) * lon(zloc+1) + if ( lono < 0.0_r8 ) lono = lono + 360.0_r8 + hghto = wght * hght(zloc) + (1.0_r8 - wght) * hght(zloc+1) + hghto = hghto * 1000.0_r8 ![hghto(km)=hghto(m)x1000] + eleco = wght * elec(zloc) + (1.0_r8 - wght) * elec(zloc+1) + + obsval = eleco + !Real observation experiment + !oerr = ionprf_obserr_percent(lono,lato,hghto,ihour,imin,f3coerr) + !oerr = 0.01_r8 * ionprf_obserr_percent(lono,lato,hghto,ihour,imin,f3coerr) * obsval + !oerr = 0.01_r8 * obsval + !oerr=abs(oerr) + + !OSSE condition + !oerr = 1400.0 !This value is apply for linear scale only. + oerr = 30000 - abs(hghto*0.105-30000) + + subset = 'GPSREF' + call set_obs_def_location(obs_def,set_location(lono,lato,hghto,3)) + call set_obs_def_kind(obs_def, GPS_PROFILE) + if (overwrite_time) then ! generally do not want to do this here. + call set_obs_def_time(obs_def, set_time(asec, aday)) + else + call set_obs_def_time(obs_def, set_time(osec, oday)) + endif + call set_obs_def_error_variance(obs_def, oerr*oerr ) + call set_obs_def_key(obs_def, obs_num) + call set_obs_def(obs, obs_def) + + obs_val(1) = obsval + call set_obs_values(obs, obs_val) + if (obsval < 1000.0) then + qc=5.00000 + elseif (obsval > 100000000.0) then + qc=5.00000 + elseif (err > 45) then + qc=5.00000 + elseif (err <-25) then + qc=5.00000 + else + qc=0.00000 + endif + qc_val(1) = qc + call set_qc(obs, qc_val) + + ! first one, insert with no prev. otherwise, since all times will be the + ! same for this column, insert with the prev obs as the starting point. + ! (this code used to call append, but calling insert makes it work even if + ! the input files are processed out of strict time order, which one message + ! i got seemed to indicate was happening...) + if (first_obs) then + call insert_obs_in_seq(obs_seq, obs) + first_obs = .false. + else + call insert_obs_in_seq(obs_seq, obs, prev_obs) + endif + obs_num = obs_num+1 + prev_obs = obs + + if (.not. did_obs) did_obs = .true. + + end do obsloop2 + + ! clean up and loop if there is another input file + deallocate( lat, lon, hght, elec ) + + filenum = filenum + 1 + +end do fileloop + +! done with main loop. if we added any obs to the sequence, write it out. +if (did_obs) then + + if (get_num_obs(obs_seq) > 0) & + call write_obs_seq(obs_seq, output_file) + + ! minor stab at cleanup, in the off chance this will someday get turned + ! into a subroutine in a module. probably not all that needs to be done, + ! but a start. + + call destroy_obs(obs) + call destroy_obs(prev_obs) + + !>@todo get core dumps here, not sure why? + !if (get_num_obs(obs_seq) > 0) call destroy_obs_sequence(obs_seq) +endif + +! END OF MAIN ROUTINE + +contains + +! local subroutines/functions follow + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! interp_height_wght - subroutine that finds the vertical levels +! closest to the desired height level and the +! weights to give to these levels to perform +! vertical interpolation. +! +! hght - height levels in column +! level - height level to interpolate to +! zgrid - index of lowest level for interpolation +! wght - weight to give to the lower level in interpolation +! iz - number of vertical levels +! +! created June 2008, Ryan Torn NCAR/MMM +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +subroutine interp_height_wght(hght, level, iz, zgrid, wght) + +use types_mod, only : r8 + +implicit none + +integer, intent(in) :: iz +real(r8), intent(in) :: hght(iz), level +integer, intent(out) :: zgrid +real(r8), intent(out) :: wght + +integer :: k, klev, kbot, ktop, kinc, kleva + +if ( hght(1) > hght(iz) ) then + kbot = iz ; ktop = 1 ; kinc = -1 ; kleva = 0 +else + kbot = 1 ; ktop = iz ; kinc = 1 ; kleva = 1 +end if + +if ( (hght(kbot) <= level) .AND. (hght(ktop) >= level) ) then + + do k = kbot, ktop, kinc ! search for appropriate level + if ( hght(k) > level ) then + klev = k - kleva + exit + endif + enddo + + ! compute the weights + zgrid = klev + wght = (level-hght(klev+1)) / (hght(klev) - hght(klev+1)) + +else + + zgrid = -1 + wght = 0.0_r8 + +endif + +return + +end subroutine interp_height_wght + +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +! +! ionprf_obserr_percent - function that computes the observation +! error for a electron density observation. +! These numbers are taken from a Liu's and Yue's +! paper. +! +! hghto - height of electron density observation +! lono - longitude of electron density observation +! lato - latitude of electron density observation +! +! created by I-TE LEE NCAR/HAO & NCU, 01/26/2010 +! +!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +function ionprf_obserr_percent(lone,late,hghte,houre,mine,oerr) + +use types_mod, only : r8 + +implicit none + +real(r8), intent(in) :: lone,late,hghte +integer , intent(in) :: houre, mine +real(r8), intent(in) :: oerr(15,37,25) + +real(r8) :: mag_eq(73), slt, ionprf_obserr_percent, lonc, mq, nlat +real(r8) :: err_top1, err_bottom1, err_obs1, err_top2, err_bottom2, err_obs2, err_obs +integer :: altc, latc, ltc + + +!Convert longitude to solar local time (simple method: longitude difference) + slt= INT(NINT( (lone/15 + houre + mine/60) *10)) + if(slt>240) then + slt = slt - 240 + elseif(slt<0) then + slt = slt + 240 + endif + +!Calculate the magnetic equator latitude (refer to IGRF output in 2008) +data mag_eq/ 11.37_r8, 11.24_r8, 11.06_r8, 10.83_r8, 10.50_r8, 10.03_r8, & + 9.43_r8, 8.75_r8, 8.11_r8, 7.61_r8, 7.32_r8, 7.22_r8, & + 7.27_r8, 7.42_r8, 7.61_r8, 7.82_r8, 8.01_r8, 8.16_r8, & + 8.23_r8, 8.21_r8, 8.08_r8, 7.89_r8, 7.75_r8, 7.64_r8, & + 7.64_r8, 7.72_r8, 7.81_r8, 7.85_r8, 7.77_r8, 7.55_r8, & + 7.18_r8, 6.64_r8, 5.93_r8, 5.07_r8, 4.12_r8, 3.16_r8, & + 2.26_r8, 1.47_r8, 0.80_r8, 0.23_r8, -0.28_r8, -0.78_r8, & + -1.30_r8, -1.86_r8, -2.46_r8, -3.08_r8, -3.69_r8, -4.31_r8, & + -4.97_r8, -5.71_r8, -6.56_r8, -7.52_r8, -8.58_r8, -9.69_r8, & + -10.78_r8, -11.71_r8, -12.34_r8, -12.46_r8, -11.90_r8, -10.61_r8, & + -8.63_r8, -6.08_r8, -3.17_r8, -0.14_r8, 2.73_r8, 5.23_r8, & + 7.28_r8, 8.85_r8, 9.98_r8, 10.75_r8, 11.20_r8, 11.38_r8, & + 11.38_r8/ + + lonc=INT(lone/5+1) + mq=mag_eq(lonc) + (mag_eq(lonc+1) - mag_eq(lonc)) / 5 * (lone+5-5*lonc) + nlat=late-mq + if(nlat > 90) then + nlat=90 + elseif(nlat <-90) then + nlat=-90 + endif + +!Linear interpolation the error percentage + latc = INT((nlat+90)/5+1) + altc = INT((hghte-100000)/50000+1) + ltc = INT(NINT(slt/10)+1) + +! err_top = oerr(altc+1,latc,ltc)+(oerr(altc+1,latc+1,ltc)-oerr(altc,latc,ltc))/5*(nlat+95-latc*5) +! err_bottom = oerr(altc,latc,ltc)+(oerr(altc,latc+1,ltc)-oerr(altc+1,latc,ltc))/5*(nlat+95-latc*5) +! err_obs = err_bottom+ (err_top-err_bottom)/50000*(hghte-50000-altc*50000) + +!!3-Dimensioonal Linear interpolation of the observation error percentage +err_top1 = oerr(altc+1,latc,ltc)+(oerr(altc+1,latc+1,ltc)-oerr(altc,latc,ltc))/5*(nlat+95-latc*5) +err_bottom1 = oerr(altc,latc,ltc)+(oerr(altc,latc+1,ltc)-oerr(altc+1,latc,ltc))/5*(nlat+95-latc*5) +err_obs1 = err_bottom1 + (err_top1-err_bottom1)/50000*(hghte-50000-altc*50000) + +err_top2 = oerr(altc+1,latc,ltc+1)+(oerr(altc+1,latc+1,ltc+1)-oerr(altc,latc,ltc+1))/5*(nlat+95-latc*5) +err_bottom2 = oerr(altc,latc,ltc+1)+(oerr(altc,latc+1,ltc+1)-oerr(altc+1,latc,ltc+1))/5*(nlat+95-latc*5) +err_obs2 = err_bottom2 + (err_top2-err_bottom2)/50000*(hghte-50000-altc*50000) + +err_obs = 10.0_r8 + err_obs1 + (err_obs2-err_obs1)/10 * (slt+10-ltc*10) + + +ionprf_obserr_percent = err_obs + +return +end function ionprf_obserr_percent + +end program + +! +! $URL$ +! $Id$ +! $Revision$ +! $Date$ diff --git a/observations/gps/convert_cosmic_iono_cdf.nml b/observations/gps/convert_cosmic_iono_cdf.nml new file mode 100644 index 0000000000..6577e586f4 --- /dev/null +++ b/observations/gps/convert_cosmic_iono_cdf.nml @@ -0,0 +1,8 @@ +&convert_cosmic_iono_nml + obs_levels = -1.0 + obs_window = 0.5 + input_file = '' + input_file_list = 'file_list.txt' + output_file = 'obs_seq.out' + / + diff --git a/observations/gps/convert_cosmic_ionosphere.f90 b/observations/gps/convert_cosmic_ionosphere.f90 index 3cd5aee992..f4cd09aca7 100644 --- a/observations/gps/convert_cosmic_ionosphere.f90 +++ b/observations/gps/convert_cosmic_ionosphere.f90 @@ -75,10 +75,10 @@ program convert_cosmic_ionosphere character(len=*), parameter :: revdate = "$Date$" character(len=*), parameter :: routine = 'convert_cosmic_ionosphere' -integer, parameter :: METHOD_CONSTANT = 1 !> = 'constant' -integer, parameter :: METHOD_SCALED = 2 !> = 'scaled' -integer, parameter :: METHOD_LOOKUP = 3 !> = 'lookup' -integer, parameter :: METHOD_SCALED_LOOKUP = 4 !> = 'scaled_lookup' +integer, parameter :: METHOD_CONSTANT = 1 !! = 'constant' +integer, parameter :: METHOD_SCALED = 2 !! = 'scaled' +integer, parameter :: METHOD_LOOKUP = 3 !! = 'lookup' +integer, parameter :: METHOD_SCALED_LOOKUP = 4 !! = 'scaled_lookup' integer :: method character (len=512) :: string1, string2, string3 @@ -400,11 +400,11 @@ program convert_cosmic_ionosphere subroutine interp_height_wght(hght, level, iz, zgrid, wght) -integer, intent(in) :: iz !> number of vertical levels -real(r8), intent(in) :: hght(iz) !> height levels in column -real(r8), intent(in) :: level !> height level to interpolate to -integer, intent(out) :: zgrid !> index of lowest level for interpolation -real(r8), intent(out) :: wght !> weight to give to the lower level in interpolation +integer, intent(in) :: iz !! number of vertical levels +real(r8), intent(in) :: hght(iz) !! height levels in column +real(r8), intent(in) :: level !! height level to interpolate to +integer, intent(out) :: zgrid !! index of lowest level for interpolation +real(r8), intent(out) :: wght !! weight to give to the lower level in interpolation integer :: k, klev, kbot, ktop, kinc, kleva @@ -443,9 +443,9 @@ end subroutine interp_height_wght function compute_lon_wrap(lon1, lon2, weight) -real(r8), intent(in) :: lon1 !> longitude in degrees between -180 and +180 -real(r8), intent(in) :: lon2 !> longitude in degrees between -180 and +180 -real(r8), intent(in) :: weight !> interpolation weight between lon1 and lon2 (0 to 1) +real(r8), intent(in) :: lon1 !! longitude in degrees between -180 and +180 +real(r8), intent(in) :: lon2 !! longitude in degrees between -180 and +180 +real(r8), intent(in) :: weight !! interpolation weight between lon1 and lon2 (0 to 1) real(r8) :: compute_lon_wrap ! if the longitudes are the same sign (both negative or both positive) @@ -501,15 +501,15 @@ end function compute_lon_wrap function electron_density_error(lon, lat, hght, ihour, imin, method, factor, obsval) -real(r8), intent(in) :: lon !> input real value geometric height [km] -real(r8), intent(in) :: lat !> latitude in degrees -real(r8), intent(in) :: hght !> height of observation -integer, intent(in) :: ihour !> hour of day ... UTC -integer, intent(in) :: imin !> minute of day ... UTC -integer, intent(in) :: method !> integer describing algorithm -real(r8), intent(in) :: factor !> multiplier to scale all the errors up or down for testing -real(r8), intent(in) :: obsval !> observation value -real(r8) :: electron_density_error !> output electron density error variance +real(r8), intent(in) :: lon !! input real value geometric height [km] +real(r8), intent(in) :: lat !! latitude in degrees +real(r8), intent(in) :: hght !! height of observation +integer, intent(in) :: ihour !! hour of day ... UTC +integer, intent(in) :: imin !! minute of day ... UTC +integer, intent(in) :: method !! integer describing algorithm +real(r8), intent(in) :: factor !! multiplier to scale all the errors up or down for testing +real(r8), intent(in) :: obsval !! observation value +real(r8) :: electron_density_error !! output electron density error variance real(r8) :: percent @@ -549,11 +549,11 @@ end function electron_density_error function ionprf_obserr_percent(lone, late, hghte, houre, mine) -real(r8), intent(in) :: lone !> longitude of electron density observation -real(r8), intent(in) :: late !> latitude of electron density observation -real(r8), intent(in) :: hghte !> height of electron density observation (in km) -integer, intent(in) :: houre !> UTC hour of day -integer, intent(in) :: mine !> UTC minute of hour +real(r8), intent(in) :: lone !! longitude of electron density observation +real(r8), intent(in) :: late !! latitude of electron density observation +real(r8), intent(in) :: hghte !! height of electron density observation (in km) +integer, intent(in) :: houre !! UTC hour of day +integer, intent(in) :: mine !! UTC minute of hour character(len=*), parameter :: routine = 'ionprf_obserr_percent' diff --git a/observations/gps/convert_cosmic_ionosphere.nml b/observations/gps/convert_cosmic_ionosphere.nml index 9a239482ca..2096ab1688 100644 --- a/observations/gps/convert_cosmic_ionosphere.nml +++ b/observations/gps/convert_cosmic_ionosphere.nml @@ -1,11 +1,13 @@ + &convert_cosmic_ionosphere_nml - input_file = '' - input_file_list = 'input_file_list.txt' - output_file = 'obs_seq.out' - observation_error_file = 'none' - observation_error_method = 'scaled_lookup' - locations_only = .false. - obs_error_factor = 1.0 - verbose = 0 - obs_levels = -1.0 + input_file = '' + input_file_list = 'input_file_list.txt' + output_file = 'obs_seq.out' + observation_error_file = 'none' + observation_error_method = 'scaled_lookup' + locations_only = .false. + obs_error_factor = 1.0 + verbose = 0 + obs_levels = -1.0 / + diff --git a/observations/gps/shell_scripts/README b/observations/gps/shell_scripts/README index 94cce2ac79..58d4f44168 100644 --- a/observations/gps/shell_scripts/README +++ b/observations/gps/shell_scripts/README @@ -1,8 +1,6 @@ -# DART software - Copyright 2004 - 2011 UCAR. This open source software is -# provided by UCAR, "as is", without charge, subject to all terms of use at +# DART software - Copyright UCAR. This open source software is provided +# by UCAR, "as is", without charge, subject to all terms of use at # http://www.image.ucar.edu/DAReS/DART/DART_download -# -# DART $Id$ Description of the scripts provided to process the COSMIC, CHAMP, GRACE and other GPS radio occultation data. @@ -69,3 +67,20 @@ the autodelete option on before doing a long run. + +Here are some examples of how to use the CDAAC Data Download Interface with wget via command line: +wget -q --http-user=xxxx --http-passwd=xxxx http://cdaac-www.cosmic.ucar.edu/cdaac/rest/tarservice/data/mission/filetype/YYYY.DDD + +Where: +mission is the CDAAC mission i.e. cosmic +filetype is the file type i.e. wetPrf +YYYY.DDD is the day of year i.e: 2012.305 + +i.e: +wget -q --http-user=xxxx --http-passwd=xxxx http://cdaac-www.cosmic.ucar.edu/cdaac/rest/tarservice/data/cosmic/atmPrf/2012.304 -O cosmic_atmPrf_2012.304.tar + +wget -q --http-user=xxxx --http-passwd=xxxx http://cdaac-www.cosmic.ucar.edu/cdaac/rest/tarservice/data/cosmic/wetPrf/2012.301 -O cosmic_wetPrf_2012.301.tar + +For more flexibility with file types and/or dateranges, please use our data download batch system delivery by going to our CDAAC High-Level Interface and choosing "Batch Delivery Data Download" + +cosmic2013/ionPrf/2009.204/ionPrf_C006.2009.204.22.51.G23_2013.3520_nc diff --git a/observations/gps/shell_scripts/test.csh b/observations/gps/shell_scripts/test.csh new file mode 100755 index 0000000000..e10909bdf8 --- /dev/null +++ b/observations/gps/shell_scripts/test.csh @@ -0,0 +1,9 @@ +#!/bin/csh +set i = 0 +while ($i == 0) +./convert_cosmic_gps_cdf +echo 'continuous? (y:0/n:1)' +set i = $< +end + + diff --git a/observations/gps/work/input.nml b/observations/gps/work/input.nml index bd39cba060..46fd8e155c 100644 --- a/observations/gps/work/input.nml +++ b/observations/gps/work/input.nml @@ -1,4 +1,3 @@ -! DART $Id$ ! ! notes on the convert_cosmic_gps_nml namelist items: ! only one of 'gpsro_netcdf_file' or 'gpsro_netcdf_filelist' can be specified: @@ -107,7 +106,8 @@ output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90' input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90' output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90' - input_files = '../../../obs_def/obs_def_gps_mod.f90' + input_files = '../../../obs_def/obs_def_upper_atm_mod.f90', + '../../../obs_def/obs_def_gps_mod.f90' / &obs_kind_nml diff --git a/observations/gps/work/mkmf_convert_cosmic_iono_cdf b/observations/gps/work/mkmf_convert_cosmic_iono_cdf new file mode 100755 index 0000000000..bda396aa34 --- /dev/null +++ b/observations/gps/work/mkmf_convert_cosmic_iono_cdf @@ -0,0 +1,18 @@ +#!/bin/csh +# +# DART software - Copyright 2004 - 2011 UCAR. This open source software is +# provided by UCAR, "as is", without charge, subject to all terms of use at +# http://www.image.ucar.edu/DAReS/DART/DART_download +# +# $Id$ + +../../../mkmf/mkmf -p convert_cosmic_iono_cdf -t ../../../mkmf/mkmf.template -c"-Duse_netCDF" \ + -a "../../.." path_names_convert_cosmic_iono_cdf + +exit $status + +# +# $URL$ +# $Revision$ +# $Date$ + diff --git a/observations/gps/work/obserr.dat b/observations/gps/work/obserr.dat new file mode 100644 index 0000000000..1c69053e9f --- /dev/null +++ b/observations/gps/work/obserr.dat @@ -0,0 +1,925 @@ +-375.714 -499.778 -499.788 -749.250 -686.830 -499.565 -499.499 -499.493 -499.539 -499.519 -499.510 -499.469 -749.250 -749.250 -561.938 + -0.284 -0.452 -0.493 -249.821 -187.384 -0.115 -0.082 -0.083 -0.091 -0.032 -0.011 0.045 -249.712 -249.733 -187.373 + 0.781 0.309 0.123 0.042 0.020 -0.023 -0.026 -0.053 -0.079 -0.092 -0.096 -0.116 -0.100 -0.097 -0.087 + 3.178 1.004 0.909 0.201 0.091 0.088 0.065 0.065 0.070 0.037 0.032 -0.005 -0.045 -0.047 -0.048 + 3.887 1.080 0.945 0.198 0.092 0.079 0.085 0.081 0.070 0.066 0.057 0.039 0.016 -0.031 -0.066 + 4.141 1.343 1.179 0.233 0.106 0.095 0.095 0.091 0.085 0.072 0.058 0.025 0.003 -0.018 -0.054 + 4.936 1.536 1.263 0.275 0.113 0.103 0.096 0.095 0.091 0.076 0.064 0.052 0.021 -0.027 -0.065 + 4.215 1.372 1.081 0.223 0.090 0.080 0.085 0.078 0.070 0.059 0.038 0.018 -0.002 -0.018 -0.048 + 3.095 1.049 0.737 0.146 0.056 0.043 0.034 0.028 0.021 0.011 0.002 -0.012 -0.027 -0.044 -0.037 + 3.168 0.895 0.702 0.113 0.034 0.027 0.023 0.025 0.023 0.018 0.017 0.002 -0.024 -0.039 -0.057 + 2.612 0.897 0.593 0.096 0.019 0.015 0.014 0.005 -0.001 -0.010 -0.016 -0.029 -0.039 -0.032 -0.023 + 5.035 1.509 0.874 0.145 0.034 0.009 0.010 0.005 -0.003 -0.007 -0.009 -0.009 -0.001 -0.004 0.034 + 8.182 2.498 1.436 0.195 0.056 0.043 0.037 0.023 0.020 0.030 0.029 0.022 0.028 0.053 0.030 + 9.827 3.695 1.801 0.311 0.102 0.085 0.079 0.071 0.067 0.056 0.051 0.050 0.049 0.037 0.017 + 8.839 3.665 1.929 0.352 0.137 0.114 0.097 0.084 0.075 0.073 0.063 0.056 0.046 0.031 0.022 + 5.052 2.792 1.377 0.246 0.094 0.074 0.060 0.063 0.058 0.030 0.037 0.032 0.036 0.055 0.031 + -0.489 -0.375 -0.124 -0.055 -0.032 -0.021 -0.001 -0.005 -0.021 0.004 0.022 -0.016 -0.009 -0.006 0.013 + -7.133 -1.836 -0.404 -0.056 -0.019 -0.013 -0.021 -0.018 -0.011 -0.022 -0.013 -0.019 -0.010 0.030 0.046 + -2.834 -1.441 -0.323 -0.077 -0.035 -0.020 -0.031 -0.036 -0.039 -0.027 -0.024 -0.004 0.021 0.045 0.014 + -6.271 -1.918 -0.682 -0.145 -0.068 -0.074 -0.089 -0.090 -0.083 -0.066 -0.043 -0.023 -0.004 -0.006 -0.012 + -2.943 -1.032 -0.136 -0.018 -0.024 -0.024 -0.021 -0.019 -0.025 -0.035 -0.025 -0.018 -0.027 -0.019 -0.029 + 1.143 1.145 1.008 0.283 0.119 0.098 0.082 0.067 0.056 0.045 0.032 0.021 0.011 -0.037 -0.026 + 7.162 3.615 1.468 0.270 0.094 0.077 0.070 0.061 0.054 0.058 0.046 0.036 0.008 -0.044 -0.017 + 4.635 1.673 1.014 0.237 0.068 0.058 0.061 0.069 0.071 0.064 0.057 0.039 0.011 -0.055 0.011 + 3.160 1.501 0.947 0.146 0.039 0.020 0.020 0.014 0.014 -0.002 -0.003 -0.011 -0.027 -0.032 0.006 + 1.424 0.299 0.061 -0.035 -0.029 -0.024 -0.020 -0.023 -0.024 -0.032 -0.024 -0.020 -0.034 -0.031 0.019 + 0.478 -0.023 -0.158 -0.027 -0.015 -0.025 -0.033 -0.040 -0.048 -0.041 -0.040 -0.050 -0.041 -0.010 -0.011 + 0.592 0.036 0.031 -0.002 -0.004 0.001 0.002 -0.003 -0.014 -0.026 -0.021 -0.011 -0.018 -0.012 -0.047 + 2.905 0.917 0.590 0.110 0.044 0.036 0.030 0.027 0.029 0.029 0.026 0.017 0.006 0.005 -0.071 + 5.623 1.552 1.087 0.207 0.094 0.091 0.091 0.087 0.071 0.060 0.050 0.029 0.010 0.010 -0.073 + 5.288 1.649 1.092 0.204 0.099 0.092 0.095 0.092 0.086 0.099 0.101 0.060 0.020 -0.029 -0.180 + 3.799 0.745 0.619 0.166 0.085 0.076 0.077 0.081 0.092 0.090 0.067 0.027 0.013 -0.033 -0.232 + 1.967 0.522 0.531 0.161 0.095 0.082 0.085 0.087 0.077 0.059 0.039 -0.008 -0.031 -0.087 -0.014 + 1.378 0.415 0.198 0.079 0.065 0.065 0.059 0.052 0.042 0.044 0.016 0.063 0.021 0.054 -125.047 + 0.538 0.111 -0.015 -0.015 0.006 -0.012 -0.016 -0.007 0.012 0.023 -0.017 0.017 0.001 0.016 -249.782 +-187.774 -249.942 -249.764 -62.470 -0.033 -0.033 -0.030 -0.000 -0.029 -0.042 -0.104 -0.160 -0.159 -62.690 -686.801 +-561.938 -749.250 -749.250 -561.945 -499.516 -499.513 -499.509 -499.505 -499.499 -499.492 -499.511 -499.527 -0.239 -561.998 -561.938 +-374.417 0.360 0.240 0.064 0.010 0.016 0.010 -374.622 0.039 0.022 -124.823 -499.494 -499.496 -499.599 -561.938 + 0.626 0.070 -0.114 -0.082 -0.061 -0.061 -0.050 -0.034 -0.014 0.004 -0.018 -0.036 -0.017 -0.118 -187.330 + 0.207 -0.053 -0.319 -0.098 -0.068 -0.073 -0.087 -0.097 -0.132 -0.156 -0.128 -0.069 -0.035 -0.019 0.020 + 2.094 0.551 0.416 0.050 0.020 0.020 0.039 0.032 0.021 0.010 0.002 -0.009 -0.035 0.009 0.016 + 3.005 0.844 0.768 0.161 0.073 0.075 0.067 0.061 0.057 0.047 0.031 0.011 -0.013 -0.030 -0.050 + 3.881 1.188 1.062 0.227 0.104 0.094 0.092 0.094 0.090 0.082 0.067 0.048 0.020 -0.012 -0.060 + 4.178 1.317 1.088 0.205 0.086 0.082 0.089 0.091 0.089 0.075 0.061 0.038 0.014 -0.019 -0.065 + 3.599 1.134 0.909 0.175 0.072 0.071 0.068 0.068 0.057 0.050 0.039 0.029 0.012 -0.017 -0.045 + 3.203 1.066 0.970 0.198 0.076 0.068 0.070 0.071 0.069 0.060 0.058 0.035 0.011 -0.013 -0.033 + 3.145 0.981 0.702 0.131 0.049 0.042 0.039 0.034 0.033 0.030 0.022 0.013 0.001 0.002 0.007 + 2.207 0.683 0.408 0.073 0.020 0.013 0.016 0.015 0.014 0.007 0.004 0.003 0.008 0.016 0.014 + 2.532 0.767 0.449 0.070 0.020 0.013 0.008 0.006 0.006 0.006 0.014 0.015 0.017 0.014 0.009 + 3.714 1.111 0.524 0.068 0.025 0.024 0.024 0.027 0.025 0.031 0.028 0.025 0.024 0.030 0.035 + 5.083 1.907 0.979 0.148 0.054 0.044 0.045 0.039 0.041 0.036 0.032 0.033 0.037 0.035 0.024 + 5.004 2.245 1.150 0.205 0.083 0.064 0.057 0.054 0.054 0.045 0.042 0.034 0.033 0.025 0.024 + 3.441 1.367 0.582 0.108 0.045 0.036 0.030 0.031 0.025 0.025 0.026 0.027 0.029 0.036 0.027 + -0.258 -0.226 -0.114 -0.047 -0.025 -0.026 -0.034 -0.032 -0.038 -0.029 -0.026 -0.021 -0.016 -0.001 0.026 + -4.648 -1.593 -0.352 -0.068 -0.036 -0.031 -0.019 -0.018 -0.012 -0.023 -0.024 -0.018 -0.009 0.001 0.027 + -7.922 -2.264 -0.442 -0.067 -0.032 -0.006 -0.001 -0.007 -0.017 -0.018 -0.023 -0.013 -0.004 0.011 0.020 + -5.038 -2.158 -0.569 -0.132 -0.072 -0.073 -0.086 -0.092 -0.098 -0.094 -0.071 -0.065 -0.047 -0.031 0.003 + -3.149 -1.269 -0.345 -0.057 -0.037 -0.034 -0.040 -0.042 -0.042 -0.037 -0.039 -0.037 -0.035 -0.026 -0.060 + 0.159 0.387 0.236 0.073 0.042 0.039 0.039 0.043 0.051 0.037 0.026 0.020 0.006 -0.009 -0.096 + 3.703 2.170 1.198 0.183 0.080 0.069 0.072 0.071 0.072 0.071 0.050 0.032 0.006 -0.040 -0.159 + 2.997 0.970 0.441 0.070 0.018 0.015 0.015 0.012 0.008 0.002 -0.006 -0.008 -0.027 -0.058 -0.089 + 0.330 0.145 -0.006 -0.033 -0.026 -0.025 -0.020 -0.016 -0.014 -0.012 -0.016 -0.027 -0.050 -0.054 -0.042 + -1.252 -0.445 -0.349 -0.087 -0.040 -0.036 -0.041 -0.048 -0.054 -0.059 -0.057 -0.051 -0.046 -0.027 -0.076 + -0.344 -0.269 -0.151 -0.043 -0.023 -0.030 -0.034 -0.039 -0.043 -0.044 -0.043 -0.037 -0.035 -0.009 -0.053 + 1.634 0.491 0.328 0.065 0.013 0.009 0.005 0.002 -0.003 -0.007 -0.004 -0.002 -0.004 -0.000 -0.055 + 4.662 1.494 1.300 0.288 0.096 0.074 0.067 0.061 0.052 0.043 0.030 0.016 0.000 -0.003 -0.058 + 6.742 1.891 1.615 0.332 0.128 0.105 0.100 0.089 0.080 0.076 0.077 0.056 0.029 -0.021 -0.105 + 5.961 1.647 1.402 0.365 0.159 0.142 0.145 0.151 0.135 0.129 0.111 0.084 0.045 0.001 -0.121 + 3.285 0.837 0.685 0.230 0.118 0.105 0.102 0.103 0.104 0.095 0.076 0.061 0.028 -0.001 -0.073 + 3.223 0.598 0.392 0.128 0.081 0.077 0.074 0.078 0.069 0.071 0.065 0.073 0.032 0.015 -0.053 + 1.406 0.319 0.193 0.093 0.061 0.067 0.077 0.081 0.091 0.091 0.109 0.123 0.092 0.129 -0.119 + 0.989 -0.000 -0.028 -0.006 -0.002 0.004 0.008 0.009 0.029 0.021 0.002 -0.006 -0.007 -0.085 -125.125 + -0.942 -0.331 -0.187 -0.095 -0.060 -0.066 -0.083 -0.079 -0.081 -0.093 -0.098 -0.086 -62.492 -0.159 -686.818 +-374.986 -499.621 -499.521 -499.509 -499.509 -499.514 -499.559 -499.543 -499.523 -374.650 -124.907 -499.503 -561.911 -499.616 -561.938 +-375.136 -499.695 -499.694 -499.543 -499.522 -499.526 -374.649 -0.063 -0.056 -0.048 -0.054 -499.487 -499.528 -374.657 -187.361 + -1.012 -0.419 -0.556 -0.160 -0.085 -0.082 -0.093 -0.092 -0.087 -0.072 -0.061 -0.079 -0.040 -0.026 -187.289 + -0.049 -0.161 -0.338 -0.087 -0.075 -0.087 -0.107 -0.135 -0.134 -0.157 -0.166 -0.143 -0.079 -0.041 0.010 + 2.192 0.548 0.411 0.047 0.031 0.001 0.006 0.004 -0.020 -0.045 -0.043 -0.075 -0.104 -0.138 -0.127 + 2.716 0.770 0.622 0.124 0.054 0.057 0.050 0.041 0.029 0.011 -0.015 -0.050 -0.065 -0.089 -0.138 + 3.221 0.976 0.816 0.159 0.079 0.071 0.074 0.069 0.063 0.049 0.032 0.005 -0.024 -0.055 -0.120 + 3.628 1.105 0.915 0.177 0.085 0.079 0.078 0.077 0.076 0.068 0.051 0.039 0.012 -0.005 -0.078 + 2.845 0.947 0.800 0.157 0.071 0.066 0.066 0.067 0.061 0.052 0.039 0.019 -0.003 -0.019 -0.061 + 3.155 1.085 0.864 0.156 0.064 0.061 0.064 0.064 0.067 0.063 0.050 0.037 0.012 -0.011 -0.035 + 1.716 0.629 0.467 0.095 0.041 0.037 0.038 0.038 0.034 0.034 0.030 0.024 0.004 -0.004 -0.006 + 0.151 0.037 0.027 0.009 -0.004 -0.004 -0.005 -0.005 -0.007 -0.012 -0.011 -0.009 -0.007 0.012 0.044 + -1.316 -0.573 -0.380 -0.072 -0.035 -0.033 -0.029 -0.028 -0.023 -0.016 -0.007 0.008 0.019 0.045 0.038 + -2.304 -0.929 -0.606 -0.119 -0.061 -0.052 -0.051 -0.044 -0.032 -0.022 -0.013 -0.004 0.015 0.030 0.045 + -1.137 -0.398 -0.247 -0.058 -0.027 -0.019 -0.014 -0.008 -0.007 -0.001 0.002 0.012 0.024 0.039 0.054 + -0.484 0.003 0.078 0.016 0.000 -0.004 -0.002 0.004 0.008 0.010 0.021 0.026 0.036 0.048 0.051 + -1.629 -0.273 0.017 0.002 0.004 0.001 -0.005 -0.005 -0.006 -0.003 0.001 0.006 0.010 0.019 0.066 + -4.731 -1.757 -0.590 -0.118 -0.075 -0.077 -0.074 -0.073 -0.065 -0.060 -0.054 -0.045 -0.028 0.022 0.032 + -6.229 -1.934 -0.543 -0.103 -0.064 -0.052 -0.060 -0.060 -0.052 -0.049 -0.041 -0.024 0.013 0.024 0.019 + -8.001 -2.457 -0.514 -0.058 -0.030 -0.026 -0.014 -0.018 -0.022 -0.015 -0.012 0.004 0.016 0.022 0.049 + -5.602 -1.781 -0.452 -0.082 -0.053 -0.050 -0.053 -0.048 -0.047 -0.047 -0.045 -0.056 -0.054 -0.042 -0.009 + -2.214 -0.835 -0.214 -0.035 -0.014 -0.016 -0.014 -0.025 -0.033 -0.035 -0.033 -0.035 -0.042 -0.057 -0.027 + -1.323 0.213 0.308 0.061 0.043 0.051 0.052 0.056 0.041 0.048 0.038 0.026 0.017 -0.013 -0.068 + 2.031 1.083 0.448 0.073 0.039 0.029 0.023 0.020 0.032 0.025 0.036 0.038 0.019 -0.025 -0.086 + 0.829 0.324 0.142 0.019 0.006 0.009 0.010 0.024 0.026 0.019 0.004 -0.009 -0.026 -0.059 -0.064 + -2.310 -0.934 -0.562 -0.119 -0.053 -0.049 -0.040 -0.044 -0.044 -0.052 -0.055 -0.058 -0.069 -0.078 -0.067 + -1.852 -0.677 -0.589 -0.151 -0.071 -0.065 -0.075 -0.081 -0.081 -0.074 -0.065 -0.061 -0.057 -0.041 -0.013 + 0.577 0.142 0.138 0.000 -0.024 -0.032 -0.033 -0.037 -0.045 -0.044 -0.047 -0.040 -0.032 -0.003 -0.075 + 2.867 0.945 0.813 0.176 0.048 0.030 0.016 0.007 0.003 -0.004 0.002 0.002 -0.005 0.001 -0.072 + 5.496 1.491 1.529 0.346 0.097 0.071 0.067 0.057 0.043 0.045 0.037 0.030 0.018 0.002 -0.110 + 7.174 2.099 2.075 0.484 0.159 0.129 0.124 0.115 0.105 0.091 0.071 0.047 0.024 -0.003 -0.107 + 6.213 1.816 1.799 0.473 0.173 0.150 0.143 0.135 0.125 0.108 0.096 0.069 0.035 -0.012 -0.126 + 4.903 1.048 0.899 0.294 0.141 0.128 0.126 0.114 0.098 0.082 0.053 0.019 -0.010 -0.062 -0.119 + 4.491 1.086 0.766 0.215 0.093 0.084 0.078 0.085 0.087 0.076 0.058 0.053 0.026 0.013 -0.154 + 2.155 0.409 0.225 0.054 0.021 0.024 0.036 0.041 0.044 0.048 0.057 0.036 0.048 0.046 -0.003 + 1.285 0.173 0.025 0.003 0.013 0.028 0.047 0.056 0.063 0.058 0.061 0.048 0.085 0.162 -124.854 + 0.538 -0.025 -0.205 -0.098 -0.043 -0.039 -0.033 -0.010 0.011 0.028 0.056 0.112 -249.638 -249.683 -686.823 +-375.020 -499.623 -499.654 -499.550 -499.522 -499.517 -0.035 -0.021 -499.503 -499.496 -499.481 -499.458 -749.250 -749.250 -561.938 + 1.021 -124.695 -499.507 -499.506 -374.620 0.017 0.017 0.018 -499.490 -499.482 -499.517 -499.542 -499.529 -499.528 -374.625 + 1.372 0.289 -0.054 -0.119 -0.071 -0.100 -0.107 -0.112 -0.087 -0.050 -0.038 -0.032 0.000 -0.001 -0.002 + 1.289 0.227 0.164 0.037 0.007 -0.004 -0.030 -0.033 -0.041 -0.056 -0.022 0.004 -0.003 -0.015 0.032 + 2.547 0.759 0.631 0.122 0.079 0.079 0.074 0.058 0.046 0.004 -0.052 -0.061 -0.052 -0.053 -0.067 + 2.309 0.666 0.637 0.122 0.067 0.067 0.066 0.063 0.045 0.036 0.040 0.011 -0.035 -0.052 -0.086 + 2.776 0.894 0.803 0.152 0.083 0.077 0.078 0.080 0.087 0.076 0.059 0.044 0.028 0.012 -0.070 + 3.486 1.131 1.031 0.189 0.096 0.091 0.091 0.089 0.083 0.078 0.062 0.037 -0.003 -0.033 -0.079 + 2.981 0.899 0.752 0.152 0.072 0.068 0.071 0.073 0.075 0.065 0.043 0.022 -0.005 -0.038 -0.076 + 1.587 0.518 0.428 0.078 0.034 0.035 0.037 0.035 0.029 0.025 0.026 0.009 -0.009 -0.029 -0.054 + 0.386 0.173 0.157 0.028 0.008 0.007 0.007 0.008 0.006 0.003 -0.009 -0.018 -0.031 -0.050 -0.047 + -1.294 -0.381 -0.218 -0.043 -0.022 -0.021 -0.023 -0.022 -0.025 -0.023 -0.024 -0.018 -0.019 -0.019 -0.013 + -3.319 -1.263 -0.794 -0.135 -0.067 -0.061 -0.057 -0.055 -0.050 -0.046 -0.039 -0.037 -0.030 -0.018 0.005 + -3.823 -1.420 -0.875 -0.161 -0.078 -0.073 -0.075 -0.076 -0.073 -0.069 -0.064 -0.052 -0.044 -0.030 -0.002 + -3.421 -1.249 -0.726 -0.133 -0.071 -0.067 -0.066 -0.063 -0.059 -0.055 -0.048 -0.042 -0.025 -0.009 0.014 + -2.581 -0.850 -0.325 -0.054 -0.032 -0.030 -0.032 -0.037 -0.035 -0.032 -0.025 -0.014 -0.002 0.014 0.032 + -3.249 -0.702 -0.246 -0.032 -0.025 -0.035 -0.046 -0.050 -0.049 -0.044 -0.039 -0.022 -0.004 0.029 0.051 + -3.093 -1.500 -0.643 -0.140 -0.083 -0.085 -0.079 -0.071 -0.069 -0.068 -0.060 -0.058 -0.040 -0.026 -0.011 + -4.867 -1.596 -0.464 -0.080 -0.063 -0.054 -0.049 -0.052 -0.044 -0.044 -0.037 -0.041 -0.027 -0.025 -0.011 + -5.359 -1.520 -0.272 -0.015 -0.007 -0.019 -0.024 -0.024 -0.030 -0.021 -0.006 -0.010 0.009 0.001 -0.003 + -0.703 -0.541 -0.276 -0.042 -0.026 -0.026 -0.029 -0.032 -0.039 -0.054 -0.057 -0.074 -0.063 -0.118 -0.061 + 1.006 0.229 0.016 0.008 0.014 0.017 0.008 0.000 0.001 -0.011 -0.037 -0.050 -0.078 -0.126 -0.080 + -0.438 0.192 0.270 0.053 0.043 0.047 0.051 0.050 0.042 0.036 0.014 0.001 -0.021 -0.097 -0.078 + 0.248 0.323 0.153 0.014 0.008 0.002 0.004 0.009 0.007 0.000 -0.003 -0.014 -0.050 -0.105 -0.091 + -0.464 -0.225 -0.111 -0.043 -0.024 -0.017 -0.008 -0.005 0.004 0.003 -0.005 -0.024 -0.054 -0.098 0.021 + -2.136 -0.856 -0.688 -0.160 -0.068 -0.060 -0.065 -0.072 -0.086 -0.094 -0.077 -0.070 -0.059 -0.032 0.050 + -1.279 -0.610 -0.540 -0.140 -0.073 -0.072 -0.070 -0.073 -0.071 -0.069 -0.063 -0.049 -0.035 0.000 0.022 + 0.748 0.189 0.172 0.028 -0.009 -0.020 -0.029 -0.035 -0.037 -0.034 -0.033 -0.024 -0.019 0.002 -0.008 + 3.423 1.049 0.986 0.211 0.058 0.045 0.037 0.033 0.027 0.014 0.004 0.002 -0.019 0.002 -0.014 + 5.511 1.504 1.492 0.324 0.107 0.092 0.093 0.087 0.086 0.085 0.080 0.063 0.046 -0.009 -0.052 + 7.162 2.004 2.184 0.507 0.174 0.158 0.150 0.149 0.139 0.126 0.114 0.090 0.051 -0.007 -0.021 + 6.303 1.712 1.650 0.434 0.186 0.170 0.165 0.160 0.155 0.139 0.113 0.076 0.032 -0.033 -0.077 + 4.112 0.912 0.816 0.262 0.145 0.126 0.132 0.134 0.128 0.116 0.096 0.061 0.022 -0.015 -0.104 + 3.442 0.871 0.715 0.213 0.112 0.116 0.106 0.105 0.099 0.092 0.087 0.074 0.057 0.032 -0.079 + 2.210 0.457 0.395 0.102 0.048 0.046 0.052 0.049 0.055 0.060 0.052 0.050 0.055 0.052 0.016 + 0.795 0.140 0.051 0.003 -0.008 -0.009 -0.010 -0.003 -0.002 -0.005 -0.006 0.013 0.014 0.061 -0.023 + -0.037 -0.039 -0.101 -0.075 -0.056 -0.051 -0.043 -0.032 -0.029 -0.016 0.002 -0.028 -0.035 -249.770 -561.921 + -0.727 -0.192 -0.096 -499.515 -499.509 -499.508 -499.512 -499.524 -499.534 -499.535 -499.535 -499.545 -499.535 -749.250 -561.938 + -1.764 -0.680 -0.704 -0.121 -499.514 -499.512 -499.512 -499.473 -499.456 -499.453 -499.449 -749.250 -749.250 -749.250 -561.938 + 1.544 0.342 0.204 0.001 0.001 0.012 0.023 0.019 0.022 0.039 0.047 -249.699 -249.689 -249.639 -187.268 + 1.176 0.167 0.169 0.006 0.011 0.020 0.022 0.031 0.035 0.018 0.022 0.007 0.030 0.059 -0.033 + 2.728 0.772 0.637 0.101 0.049 0.039 0.045 0.024 0.022 0.029 0.025 0.023 0.031 -0.003 -0.064 + 3.152 0.927 0.857 0.168 0.104 0.097 0.077 0.070 0.058 0.041 0.014 0.001 -0.029 -0.033 -0.056 + 3.282 0.944 0.860 0.178 0.098 0.097 0.093 0.085 0.081 0.076 0.073 0.064 0.039 0.033 -0.060 + 3.205 0.930 0.853 0.156 0.075 0.066 0.061 0.054 0.051 0.046 0.035 0.024 -0.001 -0.017 -0.045 + 2.688 0.773 0.717 0.130 0.060 0.059 0.057 0.056 0.051 0.047 0.039 0.019 0.001 -0.013 -0.038 + 1.792 0.570 0.507 0.094 0.048 0.045 0.047 0.047 0.050 0.045 0.031 0.017 -0.002 -0.023 -0.044 + 0.406 0.207 0.207 0.032 0.017 0.023 0.028 0.026 0.022 0.014 0.008 -0.008 -0.023 -0.026 -0.061 + -0.482 -0.149 -0.158 -0.043 -0.027 -0.029 -0.031 -0.030 -0.032 -0.026 -0.024 -0.018 -0.015 -0.024 -0.033 + -2.372 -0.886 -0.640 -0.126 -0.074 -0.066 -0.060 -0.056 -0.053 -0.050 -0.042 -0.028 -0.025 -0.010 -0.003 + -3.096 -1.163 -0.782 -0.140 -0.075 -0.072 -0.071 -0.067 -0.064 -0.062 -0.054 -0.041 -0.039 -0.027 0.005 + -1.562 -0.598 -0.404 -0.079 -0.052 -0.052 -0.053 -0.053 -0.047 -0.041 -0.042 -0.041 -0.019 0.010 0.049 + 0.810 0.330 0.192 0.033 0.017 0.009 -0.001 -0.018 -0.021 -0.015 -0.018 0.001 0.006 0.002 0.007 + 0.865 0.329 0.218 0.055 0.031 0.027 0.015 0.010 -0.001 -0.018 -0.028 -0.044 -0.031 -0.035 -0.020 + 2.116 0.707 0.291 0.038 0.020 -0.001 -0.020 -0.036 -0.052 -0.055 -0.062 -0.053 -0.042 -0.084 -0.085 + 1.516 0.331 0.067 -0.013 -0.003 -0.007 -0.012 -0.009 -0.009 -0.026 -0.049 -0.107 -0.121 -0.176 -0.128 + 3.292 1.067 0.515 0.112 0.080 0.052 0.025 0.000 -0.027 -0.034 -0.080 -0.068 -0.039 -0.150 -0.195 + 5.465 1.791 0.709 0.140 0.102 0.096 0.077 0.066 0.054 0.016 -0.030 -0.093 -0.146 -0.285 -0.236 + 4.884 1.530 0.730 0.135 0.108 0.113 0.099 0.073 0.031 -0.027 -0.080 -0.158 -0.189 -0.296 -0.220 + 4.455 1.372 0.728 0.111 0.079 0.076 0.068 0.065 0.050 0.029 -0.030 -0.061 -0.136 -0.217 -0.174 + 2.216 0.795 0.423 0.056 0.038 0.039 0.046 0.047 0.039 0.022 0.013 0.001 -0.026 -0.062 -0.018 + 0.730 0.070 -0.013 -0.026 -0.016 -0.015 -0.014 -0.015 -0.008 -0.006 -0.017 -0.025 -0.055 -0.101 -0.064 + -0.905 -0.412 -0.438 -0.118 -0.066 -0.060 -0.059 -0.061 -0.068 -0.068 -0.064 -0.061 -0.065 -0.066 0.000 + -0.031 -0.205 -0.311 -0.096 -0.050 -0.054 -0.058 -0.061 -0.063 -0.067 -0.061 -0.049 -0.032 0.002 0.049 + 1.295 0.400 0.252 0.031 -0.004 -0.010 -0.010 -0.016 -0.023 -0.033 -0.036 -0.035 -0.020 0.003 0.031 + 2.601 0.668 0.557 0.109 0.035 0.032 0.031 0.034 0.040 0.034 0.028 0.019 0.005 0.005 -0.035 + 3.944 1.101 1.026 0.244 0.098 0.089 0.089 0.095 0.095 0.098 0.094 0.082 0.054 0.002 -0.016 + 3.465 0.896 0.729 0.246 0.132 0.121 0.122 0.122 0.127 0.123 0.117 0.104 0.082 0.029 -0.008 + 3.440 0.753 0.576 0.226 0.143 0.137 0.134 0.126 0.117 0.108 0.091 0.072 0.058 0.020 0.052 + 3.056 0.647 0.447 0.178 0.115 0.113 0.121 0.128 0.125 0.118 0.100 0.080 0.076 0.053 0.112 + 1.859 0.393 0.228 0.121 0.095 0.093 0.090 0.083 0.081 0.084 0.097 0.104 0.109 0.061 0.023 + 1.266 0.206 0.103 0.064 0.050 0.046 0.043 0.046 0.044 0.048 0.051 0.054 0.059 0.062 0.128 + 0.735 0.083 0.022 0.001 -0.004 -0.013 -0.010 -0.013 -0.018 -0.007 0.001 -0.005 0.010 0.036 -0.008 + -0.415 -0.230 -0.223 -0.125 -0.084 -0.091 -0.096 -0.092 -0.083 -0.089 -0.066 -0.039 -0.020 -62.408 -187.284 + -1.002 -0.361 -0.289 -0.136 -0.093 -0.084 -0.082 -499.527 -499.538 -499.524 -499.510 -499.508 -499.503 -561.936 -561.938 + 0.226 -0.055 -249.707 -249.763 -499.518 -499.511 -499.509 -0.028 -187.363 -62.521 -0.120 -499.552 -561.989 -749.250 -561.938 + -0.499 -0.464 -250.086 -249.831 -0.057 -0.050 -0.053 -0.076 -187.349 -62.472 -0.046 -0.050 -62.524 -249.898 -561.938 + 1.950 0.489 0.430 0.064 0.022 0.010 0.003 0.005 0.004 -0.009 -0.014 -0.016 0.010 0.023 0.014 + 2.447 0.678 0.577 0.105 0.064 0.061 0.055 0.048 0.041 0.030 0.018 0.008 0.005 -0.011 -0.032 + 3.193 0.920 0.783 0.145 0.083 0.078 0.077 0.070 0.070 0.062 0.049 0.035 0.003 -0.048 -0.016 + 3.740 1.025 0.839 0.161 0.100 0.096 0.094 0.083 0.081 0.067 0.060 0.053 0.036 0.020 -0.049 + 3.484 0.978 0.801 0.146 0.085 0.074 0.068 0.065 0.068 0.068 0.060 0.056 0.057 0.039 0.016 + 2.539 0.733 0.557 0.089 0.055 0.050 0.052 0.051 0.045 0.041 0.037 0.026 0.015 -0.004 -0.007 + 1.805 0.499 0.367 0.058 0.026 0.026 0.026 0.023 0.021 0.014 0.006 -0.002 -0.018 -0.038 -0.036 + 1.466 0.399 0.278 0.034 0.019 0.014 0.016 0.011 0.009 0.003 -0.003 -0.010 -0.022 -0.029 -0.041 + 0.455 0.168 0.115 0.013 -0.001 -0.001 -0.004 -0.009 -0.009 -0.007 -0.009 -0.011 -0.022 -0.024 -0.034 + 0.029 -0.081 -0.115 -0.038 -0.031 -0.035 -0.033 -0.030 -0.034 -0.028 -0.023 -0.038 -0.042 -0.063 -0.040 + 0.420 -0.064 -0.066 -0.024 -0.020 -0.024 -0.032 -0.040 -0.044 -0.062 -0.070 -0.087 -0.094 -0.088 -0.056 + 2.042 0.576 0.276 0.040 0.026 0.018 0.003 -0.014 -0.018 -0.022 -0.025 -0.031 -0.034 -0.066 -0.054 + 3.694 1.079 0.614 0.136 0.095 0.094 0.070 0.056 0.050 0.029 0.007 -0.011 -0.062 -0.101 -0.103 + 5.848 1.921 1.074 0.263 0.181 0.156 0.118 0.093 0.072 0.070 0.012 -0.059 -0.064 -0.114 -0.048 + 6.383 1.736 0.920 0.202 0.155 0.150 0.128 0.103 0.057 0.022 0.009 -0.009 -0.050 -0.134 -0.145 + 5.657 1.530 0.677 0.108 0.084 0.076 0.074 0.055 0.034 -0.015 -0.089 -0.142 -0.167 -0.227 -0.276 + 5.677 1.494 0.716 0.153 0.126 0.116 0.106 0.088 0.052 0.009 -0.031 -0.106 -0.139 -0.225 -0.297 + 7.267 1.914 0.849 0.218 0.204 0.197 0.193 0.176 0.170 0.103 0.045 -0.073 -0.178 -0.294 -0.316 + 7.009 2.027 0.910 0.217 0.195 0.208 0.215 0.205 0.172 0.128 0.048 -0.050 -0.168 -0.265 -0.355 + 5.409 1.519 0.742 0.183 0.164 0.171 0.174 0.178 0.171 0.130 0.066 -0.011 -0.082 -0.153 -0.137 + 3.244 1.013 0.530 0.111 0.091 0.089 0.092 0.092 0.081 0.061 0.036 0.008 -0.053 -0.151 -0.097 + 2.074 0.601 0.244 0.019 0.013 0.013 0.009 -0.002 -0.009 -0.020 -0.033 -0.043 -0.038 -0.050 -0.036 + 0.632 0.030 -0.118 -0.056 -0.042 -0.039 -0.038 -0.036 -0.037 -0.041 -0.043 -0.039 -0.045 -0.072 -0.017 + 0.131 -0.014 -0.074 -0.053 -0.044 -0.045 -0.048 -0.055 -0.057 -0.059 -0.059 -0.063 -0.064 -0.073 -0.004 + 0.185 0.024 -0.067 -0.055 -0.040 -0.043 -0.047 -0.053 -0.054 -0.053 -0.047 -0.032 -0.042 -0.037 -0.009 + 0.466 0.137 0.087 0.007 -0.004 -0.007 -0.011 -0.012 -0.019 -0.025 -0.021 -0.016 -0.012 -0.010 -0.007 + 0.880 0.177 0.131 0.047 0.029 0.027 0.029 0.030 0.029 0.028 0.020 0.013 -0.006 -0.018 0.024 + 1.560 0.365 0.240 0.104 0.077 0.073 0.072 0.069 0.068 0.063 0.053 0.045 0.019 -0.012 0.003 + 2.092 0.435 0.234 0.123 0.099 0.091 0.086 0.081 0.075 0.061 0.046 0.033 0.021 0.011 0.007 + 1.810 0.398 0.201 0.129 0.110 0.100 0.095 0.087 0.079 0.068 0.058 0.045 0.035 0.023 0.053 + 1.390 0.308 0.135 0.080 0.070 0.061 0.050 0.037 0.029 0.019 0.015 0.024 0.030 0.033 0.060 + 0.637 0.090 0.026 0.020 0.017 0.017 0.008 0.015 0.016 0.033 0.024 0.039 0.010 0.040 0.035 + 0.239 -0.004 -0.044 -0.025 -0.021 -0.020 -0.022 -0.025 -0.025 -0.029 -0.015 -0.003 0.021 0.046 0.043 + -0.589 -0.309 -0.117 -0.065 -0.050 -0.059 -0.070 -0.072 -0.066 -0.052 -0.058 0.000 -0.002 -374.629 -561.932 +-374.872 -499.597 -499.540 -499.525 -499.519 -499.519 -0.015 -0.023 -499.530 -499.530 -0.108 -0.041 -499.508 -749.250 -561.938 +-374.221 -499.387 -499.297 -499.462 -499.488 -499.488 -499.499 -499.511 -374.632 0.022 -374.606 -499.462 -749.250 -749.250 -561.938 + 2.830 0.837 0.822 0.134 0.050 0.043 0.029 0.049 0.061 0.064 0.067 0.018 -249.730 -749.227 -561.910 + 2.548 0.662 0.572 0.080 0.050 0.048 0.060 0.074 0.067 0.064 0.056 0.063 0.072 0.065 -0.013 + 3.736 1.061 0.866 0.125 0.076 0.068 0.064 0.057 0.059 0.055 0.040 0.031 0.019 -0.001 -0.005 + 3.920 1.031 0.759 0.141 0.084 0.079 0.073 0.068 0.061 0.051 0.043 0.032 0.016 -0.008 -0.021 + 3.627 1.048 0.743 0.125 0.081 0.068 0.067 0.061 0.042 0.027 0.018 0.008 -0.007 -0.026 -0.061 + 3.382 0.838 0.551 0.095 0.056 0.046 0.038 0.030 0.032 0.033 0.021 0.010 -0.003 -0.023 -0.011 + 3.285 0.905 0.584 0.105 0.066 0.056 0.048 0.033 0.014 0.002 -0.009 -0.024 -0.034 -0.087 -0.096 + 2.896 0.770 0.414 0.051 0.028 0.030 0.023 0.021 0.011 -0.010 -0.030 -0.056 -0.077 -0.085 -0.099 + 2.148 0.597 0.351 0.055 0.031 0.019 0.015 0.008 0.003 -0.002 -0.027 -0.044 -0.066 -0.059 -0.068 + 1.420 0.409 0.160 0.021 0.009 0.006 -0.002 -0.012 -0.018 -0.034 -0.046 -0.067 -0.094 -0.116 -0.074 + 1.508 0.246 0.086 -0.003 0.000 0.000 -0.005 -0.012 -0.018 -0.022 -0.047 -0.051 -0.071 -0.052 -0.058 + 0.834 0.225 0.081 0.000 -0.010 -0.017 -0.019 -0.024 -0.034 -0.047 -0.050 -0.079 -0.086 -0.120 -0.037 + 2.327 0.481 0.160 0.027 0.021 0.017 0.008 -0.001 -0.010 -0.023 -0.035 -0.043 -0.035 -0.058 0.014 + 2.829 0.726 0.302 0.087 0.079 0.077 0.076 0.066 0.065 0.047 0.030 -0.009 -0.054 -0.156 -0.012 + 2.548 0.971 0.401 0.123 0.110 0.106 0.087 0.075 0.068 0.059 0.032 0.000 -0.032 -0.122 -0.007 + 1.611 0.726 0.399 0.113 0.097 0.086 0.082 0.081 0.055 0.024 0.020 -0.001 -0.023 -0.038 -0.007 + 1.253 0.579 0.171 0.015 0.006 0.005 0.004 0.004 -0.012 -0.014 -0.020 -0.006 0.003 0.017 -0.000 + 0.603 0.367 0.113 0.014 0.012 0.005 -0.000 -0.013 -0.005 0.007 0.029 0.033 0.008 -0.022 0.030 + 0.504 0.407 0.193 0.061 0.053 0.061 0.072 0.070 0.069 0.043 0.027 0.011 0.002 -0.020 -0.019 + 0.821 0.466 0.268 0.098 0.096 0.097 0.095 0.092 0.083 0.074 0.061 0.046 0.031 -0.013 -0.019 + 0.662 0.371 0.269 0.112 0.100 0.097 0.099 0.105 0.114 0.108 0.097 0.071 0.048 0.028 0.008 + 0.637 0.215 0.140 0.058 0.059 0.060 0.059 0.062 0.055 0.055 0.053 0.042 0.038 0.012 0.039 + 0.445 0.158 0.079 0.032 0.025 0.027 0.029 0.027 0.030 0.026 0.021 0.020 0.035 0.021 0.041 + -0.017 -0.020 -0.033 -0.018 -0.014 -0.014 -0.012 -0.011 -0.010 -0.009 -0.008 -0.004 -0.000 0.001 0.027 + -0.132 -0.028 -0.033 -0.026 -0.024 -0.027 -0.032 -0.034 -0.032 -0.028 -0.024 -0.013 -0.008 0.011 0.008 + -0.166 -0.052 -0.048 -0.037 -0.036 -0.039 -0.038 -0.039 -0.040 -0.040 -0.034 -0.025 -0.016 0.010 0.020 + 0.276 0.045 0.019 -0.003 -0.015 -0.020 -0.028 -0.035 -0.034 -0.029 -0.025 -0.016 -0.015 0.004 0.018 + 0.503 0.112 0.059 0.029 0.020 0.012 0.008 0.003 -0.001 -0.002 -0.002 -0.002 -0.012 -0.008 0.041 + 1.099 0.229 0.104 0.064 0.054 0.045 0.037 0.032 0.030 0.028 0.023 0.023 -0.006 -0.015 0.043 + 1.570 0.338 0.154 0.093 0.070 0.060 0.048 0.041 0.032 0.023 0.019 0.019 0.014 0.015 0.041 + 1.260 0.292 0.125 0.075 0.058 0.048 0.037 0.030 0.023 0.006 -0.001 0.000 -0.015 -0.011 0.010 + 1.103 0.277 0.111 0.053 0.034 0.016 0.008 -0.005 -0.014 -0.019 -0.027 -0.029 -0.044 -0.025 -0.030 + 0.758 0.216 0.061 0.011 -0.007 -0.029 -0.043 -0.046 -0.055 -0.037 -0.028 -0.005 0.018 0.026 0.012 + 0.221 0.072 -0.039 -0.056 -0.054 -0.053 -0.061 -0.070 -0.068 -0.059 -0.050 -0.028 -0.014 0.054 0.007 + -0.191 -0.077 -0.105 -0.092 -0.083 -0.103 -0.107 -0.102 -0.104 -0.093 -0.083 -0.088 -0.012 -62.382 -187.297 + -1.299 -0.295 -0.107 -124.911 -499.516 -499.526 -499.532 -499.544 -499.549 -125.021 -499.540 -499.533 -499.484 -561.916 -561.938 + 3.908 1.040 0.988 -374.532 -499.480 -499.481 -499.478 -749.250 -499.520 -499.555 -499.558 -499.519 0.171 -561.879 -561.938 + 4.011 1.014 0.862 0.118 0.024 -0.026 -0.030 -249.809 -0.074 -0.072 -0.076 -0.104 -0.037 -62.491 -187.459 + 2.960 0.728 0.488 0.056 0.025 0.035 0.013 0.015 0.037 -0.025 -0.041 -0.064 -0.028 -0.109 -0.053 + 2.824 0.727 0.511 0.109 0.073 0.063 0.065 0.059 0.052 0.037 -0.009 0.022 -0.022 -0.109 -0.061 + 3.486 0.933 0.666 0.116 0.075 0.071 0.073 0.081 0.072 0.060 0.027 0.017 -0.030 -0.022 -0.013 + 3.250 0.799 0.493 0.100 0.070 0.061 0.058 0.046 0.023 0.000 -0.021 -0.043 -0.087 -0.137 -0.089 + 3.288 0.690 0.377 0.078 0.058 0.054 0.050 0.037 0.030 0.017 -0.007 -0.026 -0.052 -0.117 -0.098 + 2.877 0.637 0.279 0.067 0.049 0.046 0.049 0.052 0.049 0.034 0.010 -0.023 -0.053 -0.066 -0.073 + 1.026 0.238 0.138 0.032 0.024 0.021 0.016 -0.001 -0.013 -0.028 -0.042 -0.049 -0.082 -0.106 -0.094 + 1.416 0.244 0.050 -0.003 -0.006 -0.004 -0.004 -0.006 -0.015 -0.030 -0.050 -0.078 -0.112 -0.094 -0.111 + 0.844 0.102 0.011 -0.006 -0.008 -0.012 -0.013 -0.020 -0.026 -0.037 -0.049 -0.052 -0.063 -0.044 -0.080 + 1.000 0.194 0.063 0.013 0.004 0.003 0.001 -0.002 -0.013 -0.016 -0.021 -0.024 -0.017 -0.068 -0.014 + 0.397 0.107 0.052 0.021 0.019 0.016 0.012 0.010 0.012 -0.000 -0.014 -0.033 -0.027 -0.065 -0.016 + 0.997 0.155 0.056 0.029 0.034 0.043 0.050 0.046 0.035 0.031 0.016 0.003 -0.010 -0.038 -0.054 + 0.738 0.191 0.121 0.066 0.064 0.066 0.072 0.080 0.079 0.074 0.059 0.019 0.005 -0.065 0.016 + 0.517 0.210 0.140 0.087 0.088 0.092 0.098 0.103 0.116 0.125 0.116 0.108 0.084 0.002 0.067 + 0.018 0.011 0.015 0.044 0.053 0.054 0.058 0.071 0.073 0.073 0.073 0.055 0.062 0.022 0.042 + -0.092 -0.057 -0.041 -0.026 -0.018 -0.012 -0.005 0.001 0.009 0.017 0.025 0.045 0.058 0.086 0.031 + -0.144 -0.120 -0.118 -0.052 -0.044 -0.038 -0.033 -0.032 -0.021 -0.009 0.000 0.011 0.041 0.085 0.060 + -0.212 -0.152 -0.122 -0.041 -0.027 -0.019 -0.018 -0.009 0.002 0.004 0.016 0.036 0.063 0.067 0.122 + -0.102 -0.048 -0.022 0.002 0.005 0.004 0.011 0.017 0.026 0.034 0.037 0.051 0.072 0.086 0.110 + 0.017 0.013 0.027 0.020 0.023 0.022 0.026 0.023 0.022 0.031 0.045 0.062 0.071 0.075 0.095 + 0.060 0.016 0.018 0.011 0.015 0.017 0.016 0.027 0.037 0.047 0.050 0.068 0.066 0.047 0.145 + 0.154 0.034 0.028 0.030 0.027 0.032 0.036 0.039 0.046 0.053 0.058 0.060 0.058 0.065 0.098 + 0.159 0.038 0.036 0.024 0.030 0.026 0.028 0.033 0.036 0.038 0.048 0.065 0.066 0.082 0.069 + 0.162 0.005 0.005 0.002 0.000 0.003 0.007 0.010 0.015 0.025 0.032 0.046 0.055 0.071 0.071 + 0.127 -0.000 -0.009 -0.015 -0.018 -0.018 -0.016 -0.011 -0.002 0.005 0.019 0.026 0.022 0.040 0.050 + 0.293 0.064 0.021 0.009 0.006 0.003 0.001 -0.001 -0.002 0.002 0.002 0.019 0.015 0.024 0.034 + 0.499 0.090 0.047 0.032 0.025 0.019 0.017 0.017 0.019 0.015 0.019 0.020 0.019 0.030 0.027 + 1.013 0.206 0.083 0.057 0.051 0.051 0.053 0.056 0.050 0.051 0.049 0.047 0.034 0.028 0.026 + 1.358 0.326 0.117 0.089 0.078 0.079 0.074 0.070 0.073 0.067 0.066 0.062 0.050 0.050 0.035 + 1.201 0.305 0.113 0.079 0.065 0.061 0.061 0.061 0.056 0.055 0.052 0.045 0.031 0.016 0.034 + 0.711 0.191 0.075 0.049 0.033 0.025 0.019 0.016 0.014 0.021 0.021 0.027 0.041 0.048 0.043 + 0.400 0.118 0.029 0.007 -0.009 -0.018 -0.022 -0.019 -0.014 -0.007 0.020 0.028 0.025 0.041 0.016 + -0.196 -0.047 -0.032 -0.035 -0.041 -0.051 -0.053 -0.056 -0.047 -0.022 -0.012 -0.008 0.003 0.021 0.012 + -0.709 -0.143 -0.055 -0.090 -0.085 -0.083 -0.087 -0.081 -0.088 -62.503 -0.085 -0.032 0.033 -187.235 -187.306 +-374.969 -499.597 -124.939 -0.033 -0.025 -0.030 -499.517 -499.512 -374.653 -62.505 -0.059 -499.492 -499.474 -686.794 -561.938 +-378.090 -499.900 -499.807 -499.559 -499.534 -499.534 -499.553 -686.826 -561.943 -499.503 -499.503 0.088 -499.478 -749.250 -561.938 + 0.319 0.713 0.573 0.077 0.019 0.017 -0.020 -187.381 -62.535 -0.126 -499.543 -499.500 0.190 -374.556 -561.932 + 3.104 0.579 0.428 0.070 0.105 0.134 0.077 0.050 0.033 0.006 -0.052 -0.081 -0.082 -0.077 -0.062 + 1.695 0.513 0.373 0.096 0.079 0.074 0.078 0.084 0.070 0.060 0.045 0.013 0.009 -0.107 -0.018 + 3.862 0.954 0.515 0.124 0.102 0.103 0.104 0.109 0.108 0.039 0.004 0.013 -0.089 -0.190 -0.108 + 2.362 0.523 0.223 0.072 0.057 0.063 0.065 0.062 0.053 0.058 0.028 0.002 -0.017 -0.054 -0.027 + 2.427 0.527 0.172 0.062 0.056 0.058 0.062 0.060 0.055 0.041 0.029 0.013 -0.014 -0.081 -0.017 + 2.077 0.409 0.140 0.057 0.050 0.050 0.046 0.047 0.048 0.046 0.032 0.021 0.013 -0.013 -0.007 + 1.797 0.372 0.110 0.037 0.034 0.033 0.032 0.027 0.017 0.012 0.006 -0.007 -0.017 -0.012 -0.002 + 1.072 0.167 0.042 0.015 0.013 0.012 0.014 0.012 0.012 0.009 -0.004 -0.001 -0.002 -0.010 -0.027 + 1.502 0.282 0.079 0.043 0.040 0.037 0.034 0.028 0.018 0.009 0.006 -0.011 -0.015 -0.016 -0.001 + 1.307 0.221 0.072 0.042 0.040 0.043 0.048 0.053 0.056 0.057 0.050 0.030 0.030 -0.076 -0.007 + 1.524 0.251 0.092 0.053 0.052 0.053 0.059 0.062 0.065 0.061 0.061 0.054 0.070 -0.002 0.070 + 1.166 0.210 0.092 0.069 0.069 0.076 0.082 0.087 0.093 0.098 0.093 0.071 0.080 -0.001 0.047 + 0.423 0.123 0.085 0.067 0.070 0.071 0.084 0.098 0.102 0.106 0.102 0.093 0.100 0.033 0.064 + -0.096 -0.026 0.030 0.062 0.079 0.094 0.106 0.118 0.130 0.141 0.134 0.139 0.138 0.083 0.125 + -0.302 -0.169 -0.111 -0.021 0.016 0.035 0.056 0.074 0.096 0.118 0.125 0.144 0.166 0.105 0.014 + -0.264 -0.162 -0.137 -0.074 -0.047 -0.036 -0.027 -0.014 0.003 0.011 0.037 0.062 0.124 0.119 0.077 + -0.241 -0.180 -0.166 -0.099 -0.076 -0.070 -0.070 -0.056 -0.048 -0.030 -0.016 0.030 0.096 0.121 0.188 + -0.259 -0.209 -0.197 -0.098 -0.069 -0.060 -0.051 -0.047 -0.034 -0.021 -0.004 0.020 0.069 0.104 0.179 + -0.243 -0.148 -0.119 -0.054 -0.028 -0.019 -0.011 -0.008 -0.004 0.006 0.016 0.042 0.066 0.074 0.167 + -0.126 -0.064 -0.053 -0.018 -0.006 -0.006 -0.010 -0.007 -0.012 -0.005 0.010 0.020 0.032 0.034 0.117 + -0.048 -0.024 0.011 0.019 0.021 0.009 0.008 0.014 0.019 0.021 0.027 0.043 0.039 0.033 0.070 + 0.066 0.022 0.029 0.035 0.042 0.049 0.051 0.049 0.053 0.060 0.054 0.042 0.037 0.029 0.049 + 0.371 0.052 0.030 0.032 0.031 0.033 0.039 0.044 0.047 0.043 0.045 0.043 0.039 0.024 0.023 + 0.613 0.095 0.039 0.023 0.023 0.023 0.022 0.020 0.019 0.020 0.020 0.012 0.022 0.003 0.046 + 0.584 0.090 0.028 0.013 0.008 0.005 0.006 0.004 0.002 0.001 -0.001 0.005 0.001 0.011 0.017 + 0.684 0.119 0.033 0.020 0.016 0.011 0.011 0.011 0.009 0.009 0.005 -0.004 -0.010 -0.021 0.010 + 0.741 0.165 0.053 0.039 0.038 0.040 0.044 0.043 0.037 0.028 0.018 0.009 -0.009 -0.034 0.001 + 0.840 0.239 0.087 0.068 0.070 0.070 0.069 0.068 0.072 0.074 0.063 0.058 0.047 -0.007 -0.007 + 0.934 0.238 0.079 0.066 0.062 0.068 0.073 0.078 0.076 0.072 0.068 0.061 0.046 0.051 0.007 + 0.711 0.189 0.070 0.058 0.050 0.052 0.057 0.063 0.067 0.067 0.059 0.054 0.036 0.020 0.009 + 0.551 0.142 0.051 0.046 0.042 0.042 0.042 0.041 0.043 0.050 0.057 0.039 0.019 0.005 0.006 + 0.111 0.038 0.015 0.018 0.022 0.028 0.039 0.051 0.059 0.059 0.051 0.048 0.028 -0.013 0.025 + -0.092 -0.056 -0.019 -0.009 -0.016 -0.021 -0.016 -0.013 -0.008 -0.006 0.015 0.036 0.065 0.068 0.080 + -0.679 -0.192 -0.063 -0.045 -0.047 -0.053 -0.052 -0.052 -0.043 -0.025 0.014 0.028 0.064 -249.647 -187.267 + -0.450 -0.052 0.217 -0.045 -0.039 -0.044 -499.520 -0.027 0.035 0.015 0.010 -499.482 -499.461 -749.250 -561.938 +-249.981 0.268 0.250 -0.023 -249.724 -249.725 -249.721 -374.601 -499.476 -499.467 -499.466 -499.480 -499.510 -499.516 -561.938 + 2.784 0.280 0.330 -0.018 -249.755 -249.731 -249.732 0.040 0.089 0.080 0.031 0.089 0.083 0.035 -187.276 + 2.233 0.385 0.402 0.096 0.063 0.074 0.087 0.098 0.120 0.130 0.132 0.110 0.136 0.131 0.075 + 3.041 0.526 0.461 0.122 0.093 0.104 0.128 0.145 0.144 0.134 0.110 0.120 0.107 0.059 0.062 + 2.061 0.471 0.205 0.091 0.094 0.107 0.108 0.113 0.121 0.122 0.119 0.109 0.105 0.090 0.063 + 1.560 0.385 0.123 0.059 0.054 0.055 0.057 0.052 0.049 0.058 0.055 0.061 0.057 0.079 0.040 + 1.546 0.342 0.092 0.049 0.043 0.046 0.051 0.051 0.063 0.061 0.059 0.046 0.037 0.015 0.041 + 1.404 0.253 0.069 0.046 0.040 0.046 0.046 0.053 0.048 0.043 0.044 0.059 0.068 0.102 0.051 + 1.193 0.237 0.069 0.041 0.041 0.046 0.049 0.050 0.056 0.055 0.046 0.046 0.056 0.080 0.047 + 1.441 0.277 0.084 0.054 0.054 0.057 0.065 0.070 0.071 0.076 0.076 0.079 0.069 0.056 0.018 + 2.028 0.402 0.115 0.070 0.064 0.069 0.076 0.080 0.094 0.092 0.092 0.080 0.085 0.059 0.039 + 1.731 0.320 0.109 0.068 0.065 0.065 0.069 0.068 0.061 0.055 0.055 0.050 0.045 0.018 0.007 + 1.582 0.301 0.103 0.070 0.065 0.063 0.067 0.068 0.074 0.075 0.071 0.044 0.039 -0.013 -0.020 + 0.797 0.193 0.077 0.060 0.057 0.057 0.063 0.075 0.079 0.080 0.076 0.065 0.074 -0.005 -0.059 + -0.001 0.012 0.033 0.049 0.062 0.069 0.071 0.063 0.062 0.064 0.063 0.044 0.047 0.008 -0.128 + -0.703 -0.265 -0.114 -0.018 0.019 0.031 0.046 0.061 0.075 0.083 0.073 0.067 0.057 0.032 -0.075 + -0.428 -0.251 -0.184 -0.093 -0.037 -0.010 0.002 0.018 0.017 0.030 0.052 0.062 0.086 0.093 -0.043 + -0.264 -0.156 -0.138 -0.106 -0.080 -0.068 -0.056 -0.046 -0.033 -0.024 -0.018 0.013 0.078 0.100 0.028 + -0.168 -0.110 -0.069 -0.048 -0.045 -0.047 -0.050 -0.053 -0.051 -0.040 -0.022 -0.002 0.036 0.097 0.071 + -0.119 -0.062 -0.060 -0.056 -0.051 -0.048 -0.049 -0.053 -0.046 -0.039 -0.022 -0.002 0.037 0.123 0.106 + -0.120 -0.071 -0.062 -0.058 -0.045 -0.040 -0.041 -0.032 -0.024 -0.015 0.000 0.015 0.035 0.095 0.084 + -0.075 -0.052 -0.050 -0.025 -0.010 -0.002 0.008 0.010 0.036 0.049 0.060 0.075 0.079 0.093 0.056 + 0.041 0.004 0.036 0.041 0.055 0.053 0.054 0.064 0.067 0.079 0.086 0.086 0.084 0.064 0.059 + 0.398 0.093 0.064 0.059 0.068 0.077 0.086 0.092 0.089 0.082 0.081 0.083 0.075 0.047 0.016 + 0.792 0.166 0.089 0.078 0.082 0.087 0.090 0.094 0.099 0.094 0.091 0.082 0.072 0.036 0.039 + 1.030 0.191 0.085 0.057 0.052 0.050 0.049 0.043 0.043 0.046 0.041 0.038 0.026 0.005 0.045 + 0.908 0.195 0.054 0.041 0.035 0.034 0.032 0.028 0.026 0.015 0.008 -0.000 0.007 0.011 0.023 + 0.958 0.209 0.058 0.036 0.032 0.030 0.031 0.033 0.026 0.022 0.018 0.013 0.010 0.025 0.001 + 0.843 0.208 0.057 0.041 0.038 0.039 0.038 0.037 0.039 0.034 0.031 0.014 0.015 0.012 0.013 + 0.971 0.277 0.082 0.061 0.055 0.052 0.052 0.052 0.048 0.046 0.035 0.034 0.028 0.011 -0.002 + 0.901 0.265 0.079 0.063 0.057 0.055 0.052 0.050 0.049 0.047 0.052 0.048 0.037 0.022 0.005 + 0.645 0.210 0.058 0.042 0.032 0.027 0.028 0.025 0.025 0.024 0.017 0.016 0.017 0.009 0.004 + 0.376 0.116 0.038 0.031 0.025 0.024 0.026 0.028 0.031 0.033 0.032 0.024 0.015 0.012 0.009 + 0.020 0.012 0.013 0.015 0.011 0.016 0.022 0.025 0.025 0.028 0.030 0.032 0.021 -0.013 0.015 + -0.452 -0.118 -0.030 -0.024 -0.012 -0.015 -0.014 -0.002 0.007 0.005 0.003 0.002 0.022 0.037 0.035 + -0.690 -0.222 -0.069 -0.052 -0.051 -0.052 -0.054 -0.058 -0.064 -0.058 -0.059 -0.047 -0.013 0.017 -187.239 + -0.636 -0.255 -0.044 -0.035 -0.049 -0.054 -0.057 -0.085 -0.071 -0.083 -124.950 -499.527 -499.509 -499.496 -561.938 +-374.674 -499.469 -499.491 -499.484 -0.004 -0.006 -0.013 -0.019 -124.904 -499.513 -499.526 -499.530 -749.250 -749.250 -561.938 + 1.763 0.178 0.103 0.018 0.017 0.042 0.060 0.073 0.090 0.043 0.028 0.005 -249.759 -249.744 -187.260 + 2.789 0.540 0.277 0.069 0.053 0.048 0.036 0.028 0.043 0.047 0.050 0.072 0.057 0.006 0.055 + 1.233 0.274 0.106 0.040 0.033 0.036 0.046 0.046 0.034 0.008 -0.002 -0.008 0.025 0.043 0.031 + 1.408 0.339 0.110 0.040 0.039 0.051 0.059 0.060 0.062 0.064 0.063 0.049 0.033 0.037 0.022 + 1.508 0.295 0.094 0.048 0.043 0.042 0.047 0.049 0.055 0.047 0.041 0.040 0.036 0.021 0.020 + 0.678 0.138 0.049 0.031 0.030 0.042 0.041 0.044 0.039 0.036 0.035 0.040 0.041 0.052 0.027 + 1.149 0.251 0.062 0.034 0.032 0.030 0.032 0.033 0.036 0.047 0.046 0.046 0.040 0.040 0.014 + 0.897 0.194 0.054 0.035 0.035 0.038 0.042 0.038 0.035 0.021 0.017 0.017 0.022 0.024 0.016 + 1.168 0.186 0.058 0.042 0.038 0.040 0.042 0.043 0.035 0.032 0.023 0.010 -0.009 -0.028 -0.020 + 1.654 0.299 0.102 0.064 0.058 0.053 0.055 0.054 0.055 0.049 0.036 0.018 -0.018 -0.060 -0.045 + 1.830 0.334 0.128 0.093 0.080 0.081 0.080 0.079 0.070 0.066 0.066 0.052 0.050 0.002 -0.049 + 1.200 0.274 0.116 0.078 0.072 0.074 0.075 0.073 0.067 0.055 0.048 0.029 0.014 -0.007 -0.035 + 0.436 0.122 0.056 0.041 0.042 0.047 0.063 0.063 0.059 0.058 0.038 0.010 -0.027 -0.059 -0.061 + -0.839 -0.179 -0.043 0.012 0.033 0.043 0.037 0.049 0.046 0.044 0.037 0.033 -0.006 -0.062 -0.100 + -0.568 -0.232 -0.133 -0.057 -0.019 0.005 0.010 0.005 0.001 -0.000 -0.005 -0.008 -0.010 0.003 -0.071 + -0.291 -0.169 -0.134 -0.087 -0.054 -0.039 -0.029 -0.015 -0.003 -0.010 -0.002 0.013 0.008 0.000 -0.034 + -0.174 -0.093 -0.081 -0.082 -0.068 -0.058 -0.053 -0.047 -0.039 -0.028 -0.017 -0.005 0.012 0.040 -0.010 + -0.057 0.002 0.015 -0.019 -0.034 -0.047 -0.049 -0.052 -0.049 -0.035 -0.017 0.003 0.038 0.102 0.028 + 0.004 0.013 0.019 0.015 -0.025 -0.033 -0.033 -0.029 -0.026 -0.022 -0.010 0.011 0.044 0.085 0.082 + -0.081 -0.044 -0.071 -0.091 -0.069 -0.053 -0.050 -0.051 -0.045 -0.024 -0.012 0.007 0.045 0.120 0.081 + -0.166 -0.137 -0.128 -0.096 -0.036 -0.014 -0.003 0.012 0.014 0.019 0.027 0.045 0.061 0.098 0.109 + -0.140 -0.077 -0.054 -0.016 0.024 0.044 0.055 0.064 0.081 0.088 0.092 0.084 0.076 0.083 0.080 + 0.243 0.076 0.065 0.052 0.071 0.078 0.091 0.095 0.100 0.105 0.112 0.102 0.102 0.108 0.098 + 0.605 0.149 0.109 0.103 0.117 0.126 0.128 0.131 0.131 0.137 0.131 0.126 0.113 0.091 0.068 + 1.645 0.396 0.160 0.120 0.113 0.113 0.126 0.136 0.139 0.127 0.115 0.099 0.075 0.042 0.046 + 1.951 0.452 0.138 0.096 0.089 0.089 0.087 0.085 0.080 0.079 0.068 0.049 0.049 0.044 0.032 + 1.458 0.363 0.102 0.069 0.060 0.055 0.050 0.049 0.044 0.041 0.042 0.038 0.039 0.044 0.024 + 1.112 0.278 0.074 0.048 0.044 0.043 0.044 0.043 0.038 0.034 0.027 0.025 0.024 0.028 0.023 + 0.995 0.280 0.077 0.057 0.050 0.046 0.046 0.046 0.048 0.045 0.042 0.033 0.027 0.015 0.019 + 0.938 0.264 0.076 0.062 0.056 0.055 0.051 0.049 0.045 0.044 0.043 0.036 0.028 0.017 0.011 + 0.698 0.203 0.061 0.048 0.041 0.038 0.042 0.042 0.042 0.042 0.040 0.039 0.034 0.041 0.033 + 0.383 0.108 0.039 0.031 0.024 0.021 0.020 0.018 0.019 0.025 0.026 0.033 0.027 0.028 0.008 + -0.004 -0.002 0.007 0.011 0.006 0.008 0.009 0.017 0.020 0.025 0.036 0.033 0.030 0.021 0.027 + -0.239 -0.054 -0.017 -0.011 -0.014 -0.013 -0.010 -0.009 -0.004 0.003 -0.001 0.006 0.010 0.038 0.025 + -0.555 -0.173 -0.050 -0.034 -0.026 -0.027 -0.021 -0.012 -0.018 -0.020 0.002 0.016 0.036 0.021 -0.011 + -0.452 -0.181 -0.049 -0.037 -0.032 -0.030 -0.028 -0.020 0.137 0.034 -0.011 -0.025 -374.561 -499.512 -374.638 +-561.938 -749.250 -749.250 -749.250 -561.965 -499.538 -499.539 -499.538 -499.535 -499.535 -499.522 -499.528 -499.524 -749.250 -561.938 +-187.079 -249.686 -249.825 -249.783 -62.455 0.009 0.010 -0.023 -0.047 -0.096 -0.165 -0.175 -0.119 -249.828 -187.390 + 0.627 0.137 0.079 0.035 0.036 0.045 0.059 0.066 0.082 0.069 0.054 0.054 0.033 0.027 0.057 + 0.950 0.245 0.109 0.035 0.034 0.043 0.048 0.055 0.059 0.053 0.045 0.036 0.028 0.005 0.020 + 0.815 0.193 0.071 0.034 0.028 0.031 0.032 0.026 0.038 0.036 0.046 0.032 0.017 0.015 0.014 + 0.294 0.075 0.018 0.013 0.016 0.018 0.022 0.023 0.009 0.001 -0.013 -0.005 0.008 0.015 0.021 + 0.611 0.137 0.040 0.025 0.024 0.024 0.026 0.030 0.032 0.030 0.026 0.024 0.011 0.007 0.013 + 0.485 0.091 0.027 0.020 0.019 0.022 0.027 0.023 0.016 0.017 0.016 0.018 0.005 -0.011 0.013 + 0.780 0.138 0.037 0.029 0.033 0.031 0.028 0.027 0.024 0.011 0.005 -0.000 0.007 -0.004 -0.008 + 1.018 0.185 0.063 0.039 0.032 0.044 0.049 0.047 0.042 0.033 0.027 0.028 0.022 0.014 0.011 + 1.697 0.328 0.101 0.066 0.060 0.045 0.046 0.054 0.049 0.037 0.021 0.001 -0.008 -0.034 0.007 + 1.785 0.373 0.144 0.091 0.093 0.095 0.092 0.079 0.080 0.072 0.060 0.032 -0.002 -0.056 -0.028 + 1.377 0.380 0.150 0.098 0.085 0.083 0.095 0.097 0.085 0.082 0.067 0.059 0.041 0.004 -0.010 + 0.000 -0.041 0.016 0.060 0.064 0.074 0.072 0.072 0.074 0.063 0.071 0.058 0.024 -0.020 0.002 + -1.055 -0.303 -0.140 -0.047 -0.007 0.021 0.037 0.046 0.050 0.048 0.027 0.026 0.030 -0.012 0.044 + -0.995 -0.461 -0.288 -0.150 -0.074 -0.038 -0.022 -0.009 0.007 0.011 0.022 0.013 0.013 0.030 -0.003 + -0.416 -0.263 -0.222 -0.144 -0.094 -0.061 -0.045 -0.037 -0.034 -0.028 -0.026 -0.014 0.006 0.018 0.042 + -0.079 -0.022 0.004 0.010 -0.021 -0.042 -0.052 -0.051 -0.044 -0.032 -0.014 -0.001 0.017 0.029 0.075 + 0.069 0.127 0.158 0.099 0.031 -0.004 -0.013 -0.012 -0.012 -0.004 0.009 0.032 0.069 0.097 0.065 + 0.045 0.070 0.122 0.118 0.040 -0.005 -0.019 -0.022 -0.012 -0.007 0.012 0.025 0.053 0.103 0.070 + -0.144 -0.097 -0.103 -0.090 -0.074 -0.062 -0.054 -0.050 -0.052 -0.047 -0.035 -0.012 0.024 0.091 0.090 + -0.413 -0.315 -0.270 -0.195 -0.103 -0.064 -0.057 -0.057 -0.046 -0.036 -0.024 -0.001 0.044 0.118 0.094 + -0.427 -0.253 -0.198 -0.110 -0.040 -0.015 -0.006 -0.009 -0.002 0.011 0.024 0.039 0.076 0.151 0.200 + -0.096 0.002 0.032 0.040 0.058 0.070 0.086 0.109 0.113 0.109 0.111 0.120 0.102 0.105 0.086 + 0.855 0.307 0.198 0.139 0.131 0.143 0.146 0.147 0.149 0.155 0.149 0.143 0.128 0.121 0.110 + 1.621 0.471 0.241 0.174 0.162 0.167 0.173 0.180 0.183 0.178 0.165 0.145 0.129 0.103 0.085 + 2.212 0.546 0.202 0.137 0.134 0.136 0.141 0.142 0.139 0.132 0.121 0.104 0.089 0.067 0.027 + 2.218 0.557 0.165 0.110 0.096 0.098 0.099 0.098 0.095 0.084 0.072 0.057 0.051 0.054 0.043 + 1.761 0.473 0.127 0.087 0.077 0.074 0.070 0.068 0.065 0.067 0.060 0.051 0.046 0.041 0.041 + 1.266 0.350 0.094 0.064 0.054 0.052 0.051 0.052 0.050 0.047 0.043 0.040 0.038 0.038 0.046 + 0.915 0.260 0.071 0.054 0.048 0.045 0.043 0.040 0.038 0.037 0.035 0.033 0.031 0.034 0.046 + 0.605 0.191 0.061 0.051 0.045 0.040 0.040 0.040 0.041 0.041 0.041 0.033 0.029 0.052 0.076 + 0.363 0.103 0.033 0.027 0.021 0.019 0.022 0.025 0.028 0.031 0.025 0.046 0.050 0.061 0.050 + 0.024 0.032 0.016 0.012 0.005 0.004 0.003 0.004 0.004 0.013 0.016 0.021 0.016 0.033 0.034 + -0.195 -0.060 -0.018 -0.008 -0.002 -0.004 -0.000 0.004 0.005 0.015 0.021 0.018 0.021 0.060 0.041 + -0.620 -0.177 -0.045 -0.022 -0.015 -0.013 -0.021 -0.025 -0.022 -0.015 -0.015 0.018 0.064 0.132 -124.750 + -0.744 -0.248 -0.055 -0.040 -0.033 -0.037 -0.039 -374.641 -499.515 -499.511 -0.021 0.027 -499.479 -499.455 -499.444 + -0.261 0.009 0.096 0.034 -499.485 -124.827 0.067 0.074 -499.495 -499.499 -374.646 -0.073 -124.936 -499.526 -499.506 + 0.312 0.066 0.094 0.053 0.039 0.042 0.050 0.059 0.067 0.060 0.052 0.031 0.013 -0.032 -124.900 + 0.238 0.091 0.068 0.028 0.024 0.032 0.040 0.048 0.060 0.065 0.070 0.067 0.055 0.021 0.015 + 0.007 -0.005 -0.012 -0.004 0.004 0.009 0.008 0.008 0.004 0.005 0.005 -0.001 0.001 -0.022 -0.003 + -0.559 -0.092 -0.036 -0.016 -0.009 -0.002 -0.004 0.012 0.016 0.017 -0.001 -0.017 -0.034 -0.052 -0.009 + 0.060 -0.025 -0.006 0.001 0.006 0.008 0.017 0.013 0.013 0.011 0.016 0.022 0.019 0.028 0.024 + 0.394 0.093 0.025 0.021 0.024 0.025 0.026 0.023 0.015 0.009 0.004 0.003 0.005 0.007 0.031 + 0.608 0.122 0.029 0.022 0.016 0.016 0.015 0.015 0.009 0.003 0.000 -0.011 -0.015 -0.039 -0.010 + 0.609 0.138 0.043 0.030 0.027 0.029 0.026 0.024 0.011 0.001 -0.005 -0.018 -0.017 -0.022 -0.017 + 1.393 0.280 0.090 0.060 0.060 0.059 0.056 0.050 0.043 0.030 0.005 -0.018 -0.031 -0.055 -0.020 + 1.951 0.401 0.138 0.086 0.074 0.073 0.075 0.070 0.060 0.050 0.029 0.012 -0.018 -0.063 -0.062 + 2.054 0.460 0.181 0.113 0.102 0.101 0.100 0.099 0.097 0.074 0.049 0.009 -0.007 -0.071 -0.009 + 1.303 0.337 0.162 0.106 0.093 0.097 0.105 0.113 0.107 0.107 0.088 0.057 0.016 -0.052 0.022 + -0.265 -0.006 0.038 0.052 0.066 0.074 0.077 0.080 0.088 0.078 0.073 0.061 0.052 -0.018 0.015 + -1.287 -0.394 -0.164 -0.062 -0.015 0.003 0.014 0.018 0.014 0.004 0.016 0.025 0.021 -0.002 0.022 + -1.121 -0.563 -0.404 -0.218 -0.117 -0.067 -0.044 -0.038 -0.028 -0.022 -0.029 -0.028 -0.014 0.007 0.036 + -0.556 -0.359 -0.280 -0.182 -0.133 -0.098 -0.076 -0.063 -0.053 -0.047 -0.045 -0.033 -0.021 0.022 0.077 + 0.017 0.057 0.072 0.036 0.004 -0.028 -0.040 -0.043 -0.040 -0.039 -0.033 -0.021 -0.002 0.023 0.053 + 0.156 0.234 0.278 0.280 0.156 0.078 0.049 0.038 0.041 0.041 0.049 0.063 0.066 0.101 0.050 + 0.104 0.132 0.172 0.157 0.091 0.045 0.037 0.045 0.047 0.054 0.061 0.076 0.112 0.114 0.082 + -0.192 -0.125 -0.107 -0.103 -0.082 -0.065 -0.054 -0.061 -0.059 -0.060 -0.048 -0.029 0.001 0.067 0.076 + -0.533 -0.454 -0.421 -0.267 -0.161 -0.125 -0.115 -0.105 -0.102 -0.091 -0.074 -0.051 -0.011 0.062 0.115 + -0.857 -0.482 -0.367 -0.207 -0.085 -0.058 -0.059 -0.062 -0.058 -0.042 -0.023 -0.009 0.020 0.078 0.203 + -0.849 -0.330 -0.176 -0.068 -0.026 -0.011 0.001 0.009 0.020 0.021 0.033 0.044 0.051 0.077 0.038 + 0.481 0.149 0.108 0.086 0.092 0.105 0.118 0.128 0.134 0.139 0.134 0.129 0.103 0.065 0.088 + 2.217 0.606 0.300 0.182 0.156 0.163 0.161 0.172 0.168 0.169 0.162 0.140 0.090 0.030 0.024 + 2.993 0.758 0.282 0.178 0.159 0.157 0.162 0.160 0.158 0.141 0.130 0.108 0.071 0.036 -0.029 + 2.829 0.700 0.220 0.146 0.130 0.131 0.131 0.129 0.124 0.119 0.102 0.082 0.073 0.034 0.023 + 2.265 0.615 0.171 0.112 0.099 0.094 0.092 0.089 0.083 0.072 0.064 0.055 0.039 0.036 0.052 + 1.392 0.378 0.101 0.069 0.057 0.053 0.050 0.044 0.040 0.035 0.035 0.035 0.038 0.040 0.060 + 0.783 0.226 0.062 0.040 0.032 0.029 0.030 0.029 0.023 0.022 0.020 0.023 0.023 0.029 0.036 + 0.415 0.112 0.033 0.025 0.020 0.017 0.013 0.010 0.014 0.014 0.012 0.013 0.015 0.029 0.041 + 0.076 0.026 0.011 0.009 0.005 0.000 -0.004 -0.003 -0.005 -0.002 0.003 0.015 0.023 0.029 0.042 + -0.061 -0.030 -0.011 -0.007 -0.010 -0.009 -0.007 -0.001 0.002 -0.005 -0.000 0.002 0.009 0.026 0.019 + -0.239 -0.064 -0.011 -0.008 -0.007 -0.006 -0.009 -0.018 -0.012 -0.002 0.004 0.010 0.020 0.065 0.039 + -0.351 -0.111 -0.008 0.005 0.020 0.017 0.028 0.029 0.049 0.062 0.062 0.086 0.090 0.161 0.095 + -0.578 -0.115 -0.043 -0.020 -0.005 -374.613 -374.561 0.167 -374.632 -124.901 -499.458 -499.432 -124.713 -499.481 -374.622 +-374.260 -499.410 -499.419 -499.481 -561.931 -749.250 -749.250 -749.250 -749.250 -749.250 -749.250 -561.901 -499.457 -561.918 -561.938 + 0.251 0.111 0.103 0.027 -62.424 -249.735 -249.720 -249.710 -249.700 -249.692 -249.710 -62.365 0.071 -62.401 -187.307 + -0.386 -0.062 -0.026 -0.011 -0.004 0.001 0.009 0.009 0.010 0.008 0.021 0.031 0.033 0.031 0.026 + -0.444 -0.029 -0.000 -0.010 -0.002 -0.009 -0.002 -0.001 0.012 0.014 0.029 0.017 0.006 -0.010 0.021 + -0.586 -0.117 -0.041 -0.019 -0.012 -0.005 -0.011 -0.011 -0.012 -0.005 -0.014 -0.033 -0.063 -0.080 -0.028 + -0.116 -0.029 -0.012 -0.000 0.005 0.008 0.011 0.009 -0.002 -0.014 -0.008 -0.009 -0.009 -0.024 -0.017 + 0.421 0.078 0.027 0.017 0.018 0.018 0.017 0.017 0.010 0.003 -0.002 -0.006 -0.015 -0.012 0.001 + 0.773 0.175 0.045 0.028 0.026 0.024 0.026 0.022 0.026 0.023 0.020 0.009 0.003 -0.032 -0.006 + 1.137 0.257 0.076 0.048 0.040 0.039 0.034 0.031 0.026 0.015 0.006 -0.008 -0.006 -0.008 -0.016 + 1.796 0.360 0.122 0.075 0.068 0.070 0.082 0.078 0.073 0.056 0.039 0.016 0.012 -0.014 0.004 + 2.385 0.484 0.171 0.099 0.085 0.087 0.087 0.079 0.084 0.082 0.078 0.054 0.037 0.016 0.005 + 2.427 0.545 0.223 0.138 0.120 0.120 0.124 0.131 0.130 0.097 0.088 0.087 0.045 -0.015 0.004 + 1.060 0.366 0.191 0.128 0.116 0.125 0.135 0.142 0.142 0.139 0.124 0.089 0.057 0.004 0.002 + -0.551 -0.084 0.000 0.034 0.056 0.061 0.071 0.076 0.075 0.080 0.079 0.092 0.057 -0.014 0.027 + -1.454 -0.470 -0.234 -0.081 -0.024 -0.006 -0.003 -0.001 0.002 -0.006 -0.004 -0.008 0.006 0.031 0.050 + -1.444 -0.743 -0.505 -0.259 -0.132 -0.087 -0.074 -0.068 -0.067 -0.069 -0.071 -0.070 -0.067 -0.009 0.057 + -0.464 -0.314 -0.260 -0.209 -0.146 -0.107 -0.090 -0.085 -0.083 -0.088 -0.084 -0.082 -0.064 -0.015 0.057 + 0.069 0.112 0.111 0.117 0.044 -0.014 -0.023 -0.021 -0.022 -0.014 -0.005 -0.012 -0.014 -0.025 0.115 + 0.311 0.393 0.494 0.406 0.188 0.102 0.088 0.085 0.085 0.092 0.092 0.087 0.079 0.020 0.061 + 0.126 0.230 0.292 0.233 0.092 0.057 0.048 0.044 0.058 0.070 0.092 0.099 0.118 0.064 0.015 + -0.339 -0.298 -0.243 -0.182 -0.129 -0.106 -0.105 -0.103 -0.097 -0.095 -0.082 -0.055 -0.007 0.070 -0.006 + -0.837 -0.658 -0.555 -0.316 -0.173 -0.137 -0.134 -0.132 -0.130 -0.120 -0.104 -0.077 -0.020 0.072 0.023 + -1.051 -0.615 -0.462 -0.260 -0.138 -0.096 -0.079 -0.079 -0.071 -0.059 -0.047 -0.037 0.026 0.109 0.059 + -0.938 -0.319 -0.185 -0.067 -0.033 -0.024 -0.019 -0.010 0.007 0.014 0.030 0.043 0.061 0.102 -0.016 + 0.156 0.036 0.080 0.075 0.085 0.090 0.092 0.104 0.110 0.104 0.106 0.087 0.087 0.064 -0.063 + 1.884 0.552 0.287 0.174 0.150 0.152 0.166 0.170 0.171 0.177 0.167 0.131 0.090 0.052 -0.000 + 3.090 0.754 0.309 0.184 0.162 0.166 0.168 0.173 0.177 0.166 0.143 0.106 0.071 0.029 0.022 + 2.912 0.744 0.237 0.158 0.141 0.138 0.133 0.125 0.121 0.106 0.089 0.072 0.027 -0.017 -0.002 + 2.443 0.636 0.178 0.113 0.094 0.092 0.093 0.093 0.082 0.070 0.049 0.023 -0.001 -0.021 -0.005 + 1.565 0.421 0.114 0.076 0.067 0.060 0.056 0.047 0.033 0.025 0.020 0.017 0.010 0.006 0.004 + 0.798 0.226 0.057 0.040 0.032 0.028 0.026 0.023 0.024 0.017 0.008 0.005 0.003 0.004 0.035 + 0.132 0.023 0.007 0.002 -0.001 -0.002 -0.005 -0.007 -0.009 -0.011 -0.005 -0.003 0.007 0.025 0.034 + -0.162 -0.061 -0.022 -0.018 -0.021 -0.024 -0.023 -0.021 -0.022 -0.021 -0.018 -0.010 -0.003 0.007 0.004 + -0.422 -0.125 -0.038 -0.034 -0.032 -0.032 -0.035 -0.035 -0.036 -0.033 -0.027 -0.019 -0.010 0.003 0.022 + -0.638 -0.195 -0.059 -0.043 -0.038 -0.037 -0.032 -0.024 -0.012 -0.006 0.006 0.012 0.016 0.018 -0.001 + -0.736 -0.248 -0.082 -0.056 -0.043 -0.026 -0.018 -0.009 -0.009 -0.004 -0.004 0.110 -187.240 0.166 -187.272 +-374.851 -499.577 -499.525 -499.515 -499.511 -499.520 -499.520 -499.519 -499.509 -499.502 0.179 -499.386 -686.767 -499.442 -561.938 +-374.437 -499.455 -499.504 -499.504 -499.494 -499.493 -499.487 -499.483 -499.478 -499.473 0.059 -374.613 -0.072 -374.661 -374.651 + -0.817 -0.222 -0.046 -0.015 -0.006 0.010 0.040 0.049 0.012 -0.036 -0.045 -499.504 0.096 0.072 0.002 + -1.298 -0.356 -0.190 -0.105 -0.047 -0.041 -0.037 -0.036 -0.005 0.011 0.011 0.009 -0.004 -0.006 -0.002 + -0.763 -0.173 -0.101 -0.043 -0.028 -0.025 -0.026 -0.029 -0.030 -0.027 -0.022 -0.013 -0.020 -0.013 0.001 + -0.786 -0.172 -0.082 -0.037 -0.019 -0.012 -0.004 -0.001 -0.008 -0.011 -0.025 -0.024 -0.029 -0.031 -0.006 + -0.503 -0.143 -0.049 -0.016 -0.011 -0.011 -0.013 -0.015 -0.015 -0.009 -0.013 -0.015 -0.022 -0.030 -0.013 + -0.242 -0.051 -0.019 -0.004 -0.001 -0.000 -0.000 -0.004 -0.008 -0.024 -0.028 -0.020 -0.018 -0.020 -0.011 + 0.384 0.060 0.020 0.013 0.014 0.011 0.008 0.001 -0.008 -0.013 -0.008 -0.013 -0.020 -0.026 -0.012 + 1.159 0.238 0.077 0.045 0.042 0.041 0.041 0.045 0.042 0.031 0.007 -0.003 -0.002 -0.016 -0.033 + 2.145 0.428 0.155 0.088 0.078 0.083 0.090 0.083 0.080 0.069 0.064 0.038 0.012 -0.024 -0.017 + 2.908 0.590 0.218 0.120 0.105 0.104 0.107 0.118 0.110 0.104 0.097 0.076 0.065 0.017 -0.028 + 3.018 0.647 0.237 0.133 0.120 0.123 0.133 0.116 0.128 0.128 0.135 0.111 0.070 0.037 -0.038 + 1.397 0.459 0.229 0.126 0.104 0.104 0.107 0.118 0.113 0.107 0.113 0.108 0.090 -0.003 -0.001 + -1.133 -0.215 -0.036 0.034 0.059 0.066 0.071 0.064 0.068 0.078 0.074 0.061 0.043 0.018 0.023 + -2.177 -0.722 -0.304 -0.083 -0.024 -0.006 0.002 0.012 0.007 -0.013 -0.023 -0.020 -0.019 -0.004 0.059 + -1.796 -0.892 -0.559 -0.279 -0.147 -0.111 -0.097 -0.099 -0.100 -0.091 -0.085 -0.087 -0.089 -0.034 0.081 + -0.684 -0.451 -0.385 -0.217 -0.138 -0.108 -0.102 -0.103 -0.103 -0.101 -0.102 -0.100 -0.095 -0.036 0.096 + 0.124 0.153 0.182 0.068 -0.014 -0.025 -0.033 -0.029 -0.027 -0.022 -0.020 -0.020 -0.028 -0.020 0.062 + 0.387 0.475 0.552 0.431 0.175 0.108 0.101 0.103 0.113 0.121 0.121 0.112 0.119 0.002 0.039 + 0.140 0.267 0.349 0.257 0.140 0.084 0.073 0.079 0.087 0.098 0.109 0.129 0.132 0.074 -0.001 + -0.417 -0.342 -0.262 -0.160 -0.095 -0.074 -0.073 -0.073 -0.071 -0.052 -0.031 -0.013 0.017 0.074 0.127 + -0.948 -0.720 -0.573 -0.303 -0.172 -0.141 -0.141 -0.138 -0.141 -0.131 -0.111 -0.081 -0.020 0.057 0.091 + -1.293 -0.746 -0.536 -0.265 -0.149 -0.121 -0.105 -0.100 -0.097 -0.091 -0.082 -0.067 -0.007 0.093 0.051 + -1.115 -0.416 -0.225 -0.100 -0.052 -0.045 -0.052 -0.046 -0.037 -0.024 -0.023 -0.016 0.011 0.073 0.109 + -0.093 0.009 0.040 0.053 0.054 0.067 0.082 0.087 0.093 0.089 0.091 0.088 0.086 0.052 0.132 + 2.410 0.637 0.330 0.203 0.185 0.184 0.182 0.191 0.192 0.180 0.166 0.128 0.077 -0.021 0.006 + 3.531 0.849 0.342 0.224 0.195 0.193 0.195 0.195 0.188 0.171 0.142 0.069 0.010 -0.073 -0.010 + 3.284 0.789 0.259 0.167 0.147 0.143 0.143 0.141 0.129 0.107 0.067 0.041 0.014 -0.029 -0.052 + 2.591 0.648 0.187 0.123 0.107 0.101 0.100 0.089 0.079 0.065 0.051 0.030 0.005 -0.010 -0.034 + 1.520 0.387 0.102 0.072 0.062 0.062 0.057 0.053 0.050 0.039 0.025 0.014 0.008 0.018 0.007 + 0.993 0.264 0.068 0.045 0.035 0.031 0.026 0.024 0.017 0.011 0.010 0.012 0.011 0.021 0.026 + 0.353 0.068 0.010 0.006 0.000 -0.004 -0.003 -0.005 -0.006 0.002 0.010 0.010 0.015 0.034 0.022 + -0.227 -0.075 -0.021 -0.016 -0.014 -0.017 -0.016 -0.013 -0.003 -0.003 0.000 0.005 0.018 0.032 0.020 + -0.395 -0.149 -0.042 -0.027 -0.023 -0.021 -0.027 -0.026 -0.029 -0.020 -0.007 -0.007 0.018 0.037 0.046 + -0.642 -0.176 -0.057 -0.046 -0.038 -0.029 -0.018 -0.012 -0.005 0.002 0.009 0.002 0.016 0.058 0.009 + -0.752 -0.268 -0.086 -0.069 -0.061 -0.052 -0.044 -0.029 -0.029 -0.023 -0.028 -0.018 0.028 0.072 -124.807 + -0.528 -0.232 -0.067 -0.053 -0.055 -0.052 -0.048 -0.046 -249.768 -0.004 0.006 0.007 0.068 -499.412 -499.496 + -1.378 -0.337 -499.625 -0.081 -0.049 -499.514 -499.515 -499.516 -499.501 -499.501 0.017 -124.866 -499.501 -499.498 -374.627 + -1.273 -0.120 -0.074 -0.034 -0.027 -0.027 -0.028 -0.017 -0.006 0.006 0.046 0.070 0.025 -124.859 -124.871 + -1.323 -0.305 -0.161 -0.068 -0.033 -0.025 -0.012 0.001 0.010 0.010 0.005 0.012 0.013 0.018 0.022 + -0.782 -0.151 -0.077 -0.037 -0.026 -0.017 -0.008 0.005 0.013 0.019 0.022 0.018 0.018 0.030 0.002 + -0.776 -0.152 -0.061 -0.020 -0.009 0.001 0.010 0.011 0.015 0.020 0.021 0.017 0.013 0.006 0.009 + -0.520 -0.092 -0.038 -0.012 -0.002 0.002 0.006 0.014 0.014 0.015 0.009 0.007 -0.001 -0.007 -0.000 + -0.154 -0.031 -0.017 -0.006 0.000 0.002 0.007 0.007 0.012 0.008 0.010 0.004 0.005 -0.005 -0.020 + 0.341 0.060 0.025 0.021 0.023 0.030 0.035 0.038 0.035 0.032 0.029 0.018 0.007 -0.003 -0.012 + 1.322 0.261 0.084 0.044 0.044 0.044 0.047 0.051 0.054 0.053 0.048 0.038 0.025 0.003 -0.010 + 1.782 0.336 0.126 0.069 0.065 0.072 0.077 0.078 0.072 0.056 0.035 0.023 0.004 -0.031 -0.003 + 3.290 0.627 0.213 0.109 0.092 0.087 0.086 0.083 0.076 0.066 0.052 0.024 0.004 -0.051 -0.059 + 3.939 0.819 0.272 0.143 0.126 0.123 0.118 0.114 0.112 0.098 0.089 0.059 0.024 -0.033 -0.054 + 2.480 0.656 0.268 0.149 0.140 0.146 0.153 0.159 0.143 0.130 0.106 0.084 0.044 -0.027 0.002 + 0.095 0.114 0.124 0.103 0.101 0.097 0.099 0.104 0.111 0.115 0.114 0.083 0.059 -0.017 0.020 + -1.819 -0.511 -0.231 -0.057 -0.007 0.019 0.034 0.023 0.030 0.026 0.028 0.031 -0.001 -0.012 0.032 + -2.029 -1.000 -0.542 -0.207 -0.098 -0.082 -0.079 -0.069 -0.074 -0.077 -0.076 -0.075 -0.054 -0.041 0.041 + -0.927 -0.574 -0.432 -0.235 -0.148 -0.115 -0.104 -0.111 -0.117 -0.117 -0.115 -0.098 -0.081 -0.040 0.033 + -0.114 -0.019 0.026 -0.030 -0.052 -0.044 -0.041 -0.042 -0.047 -0.033 -0.031 -0.033 -0.047 -0.024 -0.006 + 0.280 0.389 0.456 0.311 0.111 0.054 0.060 0.077 0.108 0.108 0.094 0.099 0.079 0.005 -0.049 + 0.126 0.215 0.273 0.211 0.093 0.064 0.058 0.061 0.066 0.075 0.104 0.107 0.110 0.053 0.061 + -0.544 -0.415 -0.289 -0.173 -0.097 -0.078 -0.074 -0.067 -0.057 -0.043 -0.047 -0.038 -0.003 0.054 0.092 + -1.163 -0.804 -0.647 -0.306 -0.174 -0.144 -0.143 -0.140 -0.134 -0.118 -0.093 -0.073 -0.028 0.053 0.106 + -1.435 -0.748 -0.439 -0.194 -0.118 -0.101 -0.088 -0.085 -0.086 -0.084 -0.074 -0.051 -0.004 0.079 0.080 + -0.868 -0.398 -0.196 -0.058 -0.010 -0.010 -0.014 -0.017 -0.014 -0.001 -0.001 0.005 0.032 0.051 0.032 + 0.837 0.313 0.225 0.127 0.108 0.119 0.131 0.137 0.135 0.130 0.120 0.102 0.084 0.053 0.074 + 2.823 0.714 0.363 0.215 0.183 0.182 0.186 0.192 0.196 0.187 0.179 0.146 0.100 0.026 0.014 + 3.992 0.947 0.393 0.231 0.197 0.196 0.199 0.202 0.193 0.180 0.154 0.114 0.076 -0.010 -0.030 + 3.693 0.873 0.292 0.181 0.161 0.159 0.157 0.152 0.149 0.123 0.089 0.044 0.016 -0.037 -0.023 + 2.692 0.643 0.198 0.129 0.110 0.105 0.105 0.098 0.090 0.082 0.065 0.046 0.029 0.019 -0.016 + 1.736 0.436 0.122 0.078 0.068 0.065 0.062 0.055 0.042 0.027 0.017 0.018 0.009 0.022 -0.011 + 0.947 0.223 0.060 0.040 0.036 0.031 0.031 0.030 0.028 0.024 0.014 0.009 -0.000 0.015 0.005 + 0.420 0.115 0.031 0.022 0.018 0.015 0.015 0.013 0.003 0.004 0.006 0.007 0.010 0.022 -0.002 + 0.036 -0.009 -0.008 -0.008 -0.008 -0.007 -0.002 -0.003 0.005 0.003 -0.001 0.003 0.020 0.028 0.023 + -0.370 -0.108 -0.030 -0.019 -0.014 -0.009 -0.006 -0.002 0.010 0.037 0.042 0.018 0.025 0.050 0.069 + -0.667 -0.207 -0.065 -0.049 -0.040 -0.035 -0.024 -0.002 0.016 0.041 0.061 0.080 0.099 0.121 0.097 + -0.571 -0.219 -0.082 -0.075 -0.068 -0.065 -0.057 -0.036 -0.023 -0.021 0.075 0.210 -62.017 0.648 0.836 +-374.673 -499.519 -499.511 -499.522 -499.524 -499.524 -499.524 -374.646 -374.583 0.286 -499.453 -499.372 -61.763 -499.227 -374.542 + -1.728 -0.459 -0.233 -0.077 -0.034 -499.506 -499.503 -499.504 -499.504 -499.503 -499.506 -499.522 -686.821 -749.250 -561.938 + -1.020 -0.369 -0.199 -0.073 -0.038 -0.040 -0.033 -0.028 -0.018 -0.019 -0.015 -0.038 -187.342 -249.774 -187.384 + -1.627 -0.461 -0.288 -0.104 -0.061 -0.050 -0.045 -0.036 -0.030 -0.019 -0.017 -0.002 0.005 0.013 0.012 + -1.608 -0.388 -0.224 -0.086 -0.056 -0.048 -0.045 -0.035 -0.027 -0.022 -0.011 -0.007 -0.012 0.008 0.016 + -1.128 -0.315 -0.161 -0.060 -0.040 -0.034 -0.031 -0.028 -0.025 -0.022 -0.019 -0.017 -0.015 -0.005 -0.008 + -0.615 -0.151 -0.068 -0.024 -0.013 -0.009 -0.007 0.000 0.006 0.009 0.007 0.006 0.007 0.000 0.005 + 0.009 0.005 0.003 -0.002 -0.002 -0.000 0.004 0.007 0.009 0.011 0.016 0.015 0.016 0.014 0.005 + 0.543 0.103 0.031 0.010 0.010 0.013 0.018 0.022 0.024 0.025 0.027 0.027 0.023 0.015 0.002 + 0.866 0.156 0.053 0.024 0.024 0.026 0.030 0.031 0.032 0.033 0.027 0.022 0.004 -0.004 -0.009 + 1.797 0.336 0.111 0.053 0.047 0.047 0.045 0.045 0.039 0.034 0.028 0.023 0.017 0.000 -0.012 + 3.254 0.604 0.207 0.097 0.086 0.085 0.087 0.084 0.081 0.067 0.052 0.037 0.010 -0.029 0.010 + 4.018 0.809 0.289 0.140 0.117 0.110 0.110 0.111 0.109 0.094 0.068 0.036 0.019 -0.054 0.021 + 3.567 0.810 0.322 0.171 0.154 0.150 0.147 0.151 0.149 0.138 0.122 0.089 0.044 -0.023 0.012 + 1.449 0.471 0.235 0.155 0.150 0.152 0.162 0.156 0.148 0.140 0.137 0.115 0.065 0.003 0.052 + -0.743 -0.311 -0.094 0.008 0.044 0.059 0.063 0.063 0.063 0.073 0.072 0.062 0.038 -0.008 0.047 + -1.778 -0.900 -0.494 -0.172 -0.074 -0.044 -0.039 -0.033 -0.031 -0.030 -0.035 -0.052 -0.048 0.001 0.054 + -0.999 -0.693 -0.468 -0.233 -0.141 -0.112 -0.103 -0.094 -0.097 -0.102 -0.100 -0.081 -0.058 -0.002 0.044 + -0.308 -0.178 -0.085 -0.061 -0.061 -0.053 -0.040 -0.046 -0.046 -0.038 -0.034 -0.027 -0.029 0.016 0.027 + 0.156 0.291 0.344 0.198 0.069 0.042 0.034 0.044 0.057 0.066 0.085 0.099 0.069 0.014 0.053 + 0.119 0.262 0.260 0.136 0.037 0.019 0.024 0.025 0.036 0.057 0.061 0.072 0.075 0.057 0.035 + -0.622 -0.519 -0.372 -0.185 -0.102 -0.076 -0.070 -0.067 -0.059 -0.040 -0.018 -0.004 0.012 0.048 0.099 + -1.357 -0.972 -0.634 -0.257 -0.143 -0.126 -0.120 -0.113 -0.102 -0.096 -0.086 -0.070 -0.023 0.029 0.080 + -1.645 -0.917 -0.516 -0.200 -0.121 -0.113 -0.104 -0.101 -0.096 -0.088 -0.073 -0.046 -0.004 0.061 0.081 + -1.158 -0.534 -0.293 -0.102 -0.053 -0.042 -0.036 -0.020 -0.017 -0.003 0.001 0.008 0.030 0.057 0.056 + 0.338 0.132 0.126 0.079 0.069 0.070 0.074 0.075 0.078 0.089 0.081 0.074 0.074 0.067 0.032 + 2.818 0.760 0.374 0.201 0.171 0.167 0.171 0.178 0.175 0.172 0.155 0.122 0.080 0.026 0.012 + 4.043 0.915 0.386 0.218 0.188 0.175 0.168 0.163 0.148 0.141 0.109 0.076 0.050 0.020 -0.037 + 3.537 0.800 0.299 0.182 0.157 0.156 0.153 0.144 0.136 0.101 0.073 0.049 -0.003 -0.028 -0.035 + 2.664 0.602 0.203 0.127 0.109 0.097 0.094 0.085 0.069 0.058 0.037 0.012 -0.018 -0.076 -0.025 + 1.993 0.466 0.147 0.097 0.078 0.072 0.065 0.059 0.052 0.042 0.030 0.012 0.007 0.015 0.003 + 1.218 0.314 0.089 0.055 0.044 0.044 0.041 0.038 0.035 0.028 0.022 0.017 0.007 0.007 0.007 + 0.508 0.143 0.040 0.026 0.019 0.017 0.017 0.015 0.011 0.012 0.005 0.007 0.008 0.019 0.034 + 0.182 0.036 0.009 0.010 0.008 0.010 0.011 0.020 0.022 0.022 0.022 0.028 0.023 0.026 0.055 + -0.145 -0.055 -0.017 -0.014 -0.009 -0.006 0.001 0.005 0.012 0.023 0.048 0.046 0.046 0.063 0.049 + -0.361 -0.125 -0.041 -0.027 -0.029 -0.027 -0.015 -0.009 0.006 0.016 0.016 0.038 0.079 0.075 0.110 + -0.514 -0.170 -0.065 -0.047 -0.042 -0.043 -0.037 -0.025 -0.032 -0.029 -0.028 0.018 0.004 -0.050 -124.919 + -0.245 -0.095 -0.035 -0.035 -0.029 -0.024 -0.016 -0.024 -374.621 -499.488 -499.495 -0.020 -499.523 -499.531 -499.509 + -0.299 -0.087 0.024 0.004 -124.852 -499.509 -499.508 -499.505 -0.031 -0.036 -499.510 -499.516 -749.250 -749.250 -561.938 + -1.641 -0.379 -0.293 -0.124 -0.054 -0.047 -0.048 -0.049 -0.040 -0.033 -0.026 -0.030 -249.764 -249.743 -187.306 + -1.972 -0.527 -0.383 -0.145 -0.085 -0.068 -0.066 -0.058 -0.055 -0.049 -0.037 -0.026 -0.013 -0.001 0.004 + -0.956 -0.281 -0.218 -0.078 -0.049 -0.049 -0.051 -0.051 -0.044 -0.040 -0.032 -0.021 -0.021 -0.012 0.000 + -0.226 -0.085 -0.087 -0.042 -0.034 -0.037 -0.037 -0.032 -0.035 -0.028 -0.025 -0.026 -0.018 -0.011 0.000 + -0.206 -0.078 -0.043 -0.019 -0.014 -0.014 -0.012 -0.014 -0.013 -0.011 -0.010 -0.012 -0.014 -0.018 0.001 + -0.050 -0.043 -0.026 -0.013 -0.009 -0.007 -0.008 -0.003 0.000 -0.002 -0.004 -0.005 -0.009 -0.021 -0.021 + 0.350 0.021 -0.009 -0.003 -0.001 0.000 0.003 0.002 0.002 0.001 -0.000 0.000 -0.008 -0.022 -0.027 + 0.941 0.139 0.032 0.003 0.001 -0.001 0.002 0.001 -0.001 -0.004 -0.011 -0.016 -0.024 -0.034 -0.045 + 1.969 0.375 0.129 0.045 0.042 0.041 0.042 0.035 0.029 0.017 0.018 0.006 -0.006 -0.019 -0.013 + 4.173 0.814 0.253 0.084 0.066 0.064 0.065 0.065 0.057 0.043 0.022 -0.001 -0.023 -0.065 -0.057 + 5.351 1.093 0.372 0.140 0.122 0.113 0.103 0.097 0.087 0.063 0.036 0.016 -0.008 -0.032 -0.063 + 5.829 1.420 0.518 0.215 0.183 0.170 0.166 0.160 0.149 0.138 0.112 0.074 0.018 -0.037 -0.038 + 3.649 1.161 0.480 0.238 0.225 0.225 0.241 0.244 0.239 0.217 0.190 0.149 0.080 -0.029 0.029 + 0.162 0.125 0.141 0.116 0.141 0.158 0.172 0.176 0.171 0.162 0.156 0.130 0.108 0.067 0.081 + -1.092 -0.556 -0.242 -0.045 0.017 0.038 0.036 0.040 0.044 0.041 0.034 0.054 0.066 0.025 0.104 + -0.758 -0.621 -0.372 -0.137 -0.085 -0.053 -0.036 -0.032 -0.033 -0.021 -0.006 -0.007 0.017 0.031 0.078 + -0.286 -0.280 -0.185 -0.089 -0.058 -0.048 -0.032 -0.019 -0.011 -0.014 -0.016 -0.022 0.014 0.031 0.063 + -0.031 0.103 0.176 0.082 0.026 0.015 0.017 0.024 0.027 0.041 0.043 0.057 0.080 0.061 0.086 + -0.127 0.023 0.116 0.019 -0.022 -0.016 -0.006 0.001 0.014 0.030 0.052 0.071 0.082 0.079 0.108 + -0.533 -0.457 -0.283 -0.127 -0.083 -0.074 -0.076 -0.075 -0.070 -0.054 -0.034 -0.006 0.028 0.064 0.101 + -1.281 -0.896 -0.523 -0.180 -0.094 -0.080 -0.081 -0.086 -0.081 -0.073 -0.057 -0.039 -0.016 0.041 0.100 + -1.461 -0.807 -0.385 -0.127 -0.067 -0.059 -0.057 -0.052 -0.052 -0.055 -0.051 -0.049 -0.018 0.037 0.091 + -0.948 -0.370 -0.136 -0.027 -0.009 -0.006 0.003 0.002 0.001 0.007 0.009 0.015 0.025 0.019 0.033 + 0.399 0.208 0.147 0.096 0.081 0.080 0.080 0.090 0.087 0.078 0.076 0.075 0.064 0.069 0.022 + 2.094 0.617 0.380 0.175 0.140 0.140 0.142 0.139 0.134 0.125 0.118 0.103 0.072 0.013 -0.007 + 2.942 0.692 0.338 0.166 0.134 0.126 0.120 0.121 0.128 0.128 0.117 0.088 0.046 0.005 -0.011 + 2.742 0.613 0.281 0.154 0.130 0.117 0.113 0.103 0.092 0.081 0.064 0.049 0.025 0.021 -0.004 + 2.423 0.516 0.198 0.124 0.105 0.097 0.094 0.089 0.083 0.067 0.055 0.036 0.023 -0.001 -0.004 + 1.799 0.386 0.136 0.092 0.076 0.069 0.066 0.063 0.059 0.057 0.048 0.048 0.027 0.019 -0.001 + 1.215 0.294 0.090 0.067 0.060 0.055 0.054 0.051 0.044 0.037 0.025 0.019 0.010 -0.002 -0.007 + 0.750 0.195 0.057 0.042 0.034 0.029 0.024 0.024 0.024 0.023 0.025 0.024 0.016 0.018 0.022 + 0.512 0.150 0.044 0.031 0.028 0.026 0.024 0.022 0.017 0.012 0.011 0.010 0.010 0.022 0.062 + 0.328 0.096 0.032 0.018 0.013 0.009 0.004 0.004 0.002 0.014 0.009 -0.003 -0.013 -0.019 0.034 + 0.175 0.064 0.012 0.016 0.014 0.006 0.003 0.000 0.005 -0.011 -0.007 0.003 -0.005 0.008 -0.020 +-187.021 -187.236 0.020 0.009 0.011 0.016 0.017 0.016 -0.001 -0.022 -0.039 -0.050 -0.053 -0.080 -0.069 +-187.269 -187.312 -0.006 -0.014 -0.013 -499.506 -499.507 -0.056 -374.648 -499.510 -499.513 -499.522 -499.526 -499.530 -374.643 +-374.761 -124.716 0.171 0.015 -374.670 -0.107 -0.112 -124.970 -499.527 -0.127 -0.148 -499.538 -499.526 -749.250 -561.938 + -1.820 -0.300 -0.355 -0.153 -0.080 -0.074 -0.082 -0.095 -0.112 -0.108 -0.106 -0.100 -0.092 -249.797 -187.349 + -1.315 -0.303 -0.357 -0.158 -0.085 -0.083 -0.081 -0.075 -0.066 -0.061 -0.055 -0.055 -0.053 -0.051 -0.016 + -1.020 -0.151 -0.221 -0.078 -0.054 -0.064 -0.073 -0.074 -0.077 -0.083 -0.078 -0.079 -0.062 -0.042 -0.023 + -0.221 0.088 -0.065 -0.051 -0.043 -0.047 -0.052 -0.056 -0.054 -0.048 -0.037 -0.035 -0.027 -0.027 0.011 + 0.746 0.185 0.023 -0.028 -0.028 -0.034 -0.040 -0.045 -0.044 -0.041 -0.043 -0.042 -0.039 -0.039 -0.009 + 0.418 0.112 -0.012 -0.026 -0.023 -0.027 -0.031 -0.033 -0.033 -0.035 -0.034 -0.032 -0.030 -0.046 -0.003 + 0.366 0.058 -0.036 -0.026 -0.023 -0.026 -0.029 -0.029 -0.030 -0.028 -0.024 -0.015 -0.005 -0.011 0.000 + 1.424 0.287 0.049 -0.004 -0.003 -0.002 -0.002 -0.001 0.000 0.002 0.003 -0.011 -0.012 -0.019 0.012 + 3.491 0.728 0.195 0.035 0.026 0.023 0.022 0.017 0.013 0.007 0.006 0.009 0.004 -0.007 0.014 + 7.500 1.571 0.430 0.095 0.071 0.063 0.056 0.050 0.039 0.027 0.014 -0.001 -0.012 -0.031 -0.007 + 13.084 2.858 0.732 0.162 0.121 0.108 0.102 0.091 0.073 0.054 0.030 0.011 -0.012 -0.028 -0.021 + 15.538 3.826 0.990 0.257 0.199 0.180 0.162 0.145 0.132 0.114 0.089 0.050 0.004 -0.044 -0.044 + 13.733 3.697 0.932 0.277 0.219 0.200 0.185 0.176 0.154 0.137 0.118 0.091 0.052 0.011 -0.036 + 6.567 2.072 0.586 0.212 0.201 0.206 0.200 0.198 0.182 0.162 0.142 0.106 0.067 0.007 -0.012 + -2.908 -0.907 -0.190 -0.016 0.039 0.055 0.066 0.071 0.073 0.077 0.075 0.058 0.045 0.010 0.033 + -4.035 -1.885 -0.553 -0.155 -0.079 -0.053 -0.037 -0.031 -0.033 -0.036 -0.036 -0.030 0.010 -0.001 0.005 + -2.622 -1.308 -0.421 -0.115 -0.076 -0.063 -0.059 -0.054 -0.042 -0.028 -0.001 0.024 0.064 0.030 0.090 + -0.748 -0.244 0.004 -0.002 -0.018 -0.022 -0.022 -0.018 -0.022 -0.016 -0.015 0.028 0.083 0.094 0.074 + -1.031 -0.562 -0.162 -0.070 -0.066 -0.057 -0.049 -0.042 -0.031 -0.018 -0.000 0.010 0.042 0.008 0.038 + -2.468 -1.450 -0.632 -0.199 -0.099 -0.083 -0.073 -0.066 -0.057 -0.042 -0.029 -0.003 0.040 0.043 0.081 + -2.442 -1.759 -0.658 -0.180 -0.090 -0.068 -0.064 -0.060 -0.052 -0.044 -0.026 -0.001 0.033 0.083 0.110 + -2.056 -1.038 -0.414 -0.103 -0.057 -0.050 -0.040 -0.033 -0.026 -0.016 -0.008 -0.000 0.019 0.083 0.076 + -0.991 -0.341 -0.077 -0.007 -0.000 0.005 0.008 0.008 0.006 0.011 0.011 0.012 0.019 0.055 0.086 + 0.583 0.246 0.124 0.054 0.050 0.051 0.053 0.059 0.062 0.067 0.075 0.058 0.055 0.056 0.091 + 1.144 0.448 0.281 0.109 0.081 0.079 0.079 0.089 0.083 0.070 0.070 0.068 0.060 0.058 0.062 + 1.983 0.505 0.284 0.103 0.080 0.078 0.081 0.077 0.081 0.080 0.077 0.059 0.044 0.028 0.014 + 1.675 0.361 0.216 0.107 0.082 0.076 0.078 0.079 0.072 0.060 0.037 0.021 0.006 0.000 -0.010 + 1.608 0.354 0.191 0.087 0.069 0.064 0.058 0.056 0.047 0.039 0.031 0.006 -0.009 -0.028 -0.017 + 1.418 0.299 0.134 0.076 0.066 0.060 0.055 0.046 0.034 0.025 0.010 0.002 -0.006 -0.017 -0.012 + 1.223 0.267 0.105 0.065 0.054 0.049 0.044 0.037 0.032 0.019 0.010 0.004 -0.001 -0.023 -0.015 + 0.932 0.230 0.072 0.055 0.048 0.041 0.033 0.023 0.015 0.012 0.010 -0.001 -0.014 -0.025 -0.024 + 0.709 0.192 0.051 0.047 0.039 0.031 0.026 0.020 0.020 0.011 0.003 0.002 -0.017 -0.015 0.002 + 0.450 0.152 0.053 0.048 0.042 0.034 0.020 0.011 0.002 -0.009 -0.011 -0.020 -0.019 -0.036 -0.065 + 0.214 0.092 0.027 0.026 0.023 0.020 0.028 0.014 0.002 -0.002 0.000 -0.005 -0.018 -0.008 0.032 + -0.011 -187.278 -249.743 -249.749 -0.010 -0.027 -0.042 -0.047 -0.047 -0.050 -0.074 -0.017 -0.001 0.334 0.066 +-374.789 -187.415 -249.771 -249.760 -499.504 -499.507 -499.509 -124.906 -0.060 -374.656 -374.629 -249.736 -0.138 -0.103 -374.646 +-375.353 -1.850 -1.358 -0.275 -0.118 -499.528 -124.956 -0.103 -0.100 -0.104 -0.117 -0.100 -124.956 -499.497 -374.621 + -0.607 -0.292 -0.420 -0.134 -0.079 -0.085 -0.089 -0.078 -0.062 -0.053 -0.026 -0.008 0.025 0.016 0.046 + -0.780 -0.354 -0.461 -0.132 -0.071 -0.072 -0.076 -0.073 -0.072 -0.061 -0.050 -0.045 -0.042 -0.007 0.017 + 0.306 -0.110 -0.199 -0.082 -0.052 -0.055 -0.056 -0.058 -0.050 -0.049 -0.039 -0.024 -0.012 -0.011 0.016 + 0.314 0.016 -0.103 -0.038 -0.028 -0.033 -0.038 -0.039 -0.044 -0.038 -0.030 -0.014 -0.000 0.026 0.040 + 1.116 0.236 0.082 -0.004 -0.015 -0.022 -0.025 -0.024 -0.022 -0.020 -0.016 -0.013 -0.007 0.000 0.014 + 1.527 0.321 0.109 0.005 -0.005 -0.010 -0.014 -0.018 -0.022 -0.019 -0.016 -0.013 -0.005 0.001 0.025 + 1.666 0.327 0.091 0.001 -0.006 -0.012 -0.017 -0.017 -0.015 -0.011 -0.001 0.006 0.019 0.019 0.025 + 2.084 0.523 0.189 0.025 0.010 0.006 0.007 0.007 0.007 0.007 0.003 0.011 0.014 0.018 0.032 + 3.538 0.870 0.250 0.029 0.015 0.011 0.005 0.005 0.002 0.002 0.000 -0.004 -0.005 -0.006 -0.000 + 8.154 2.038 0.563 0.089 0.050 0.041 0.036 0.022 0.013 0.005 -0.002 -0.008 -0.013 -0.011 -0.002 + 15.272 4.048 1.086 0.187 0.111 0.089 0.073 0.060 0.044 0.025 0.009 -0.007 -0.018 -0.035 -0.008 + 21.165 5.972 1.524 0.298 0.182 0.154 0.127 0.108 0.091 0.065 0.045 0.016 -0.012 -0.038 -0.046 + 21.415 6.575 1.589 0.347 0.237 0.204 0.180 0.149 0.121 0.092 0.061 0.026 0.010 -0.033 -0.033 + 13.372 4.384 1.165 0.273 0.193 0.174 0.169 0.165 0.157 0.135 0.104 0.068 0.008 -0.066 -0.060 + -0.626 -0.167 -0.006 0.035 0.051 0.072 0.071 0.077 0.065 0.053 0.038 0.026 0.023 -0.015 -0.015 + -7.262 -2.727 -0.576 -0.129 -0.076 -0.058 -0.049 -0.049 -0.052 -0.043 -0.038 -0.027 -0.018 -0.039 -0.020 + -7.660 -2.410 -0.559 -0.157 -0.089 -0.072 -0.071 -0.066 -0.052 -0.046 -0.039 -0.025 -0.010 -0.005 -0.010 + -4.938 -1.347 -0.280 -0.069 -0.048 -0.048 -0.040 -0.029 -0.025 -0.019 -0.004 0.003 0.023 0.013 0.013 + -8.493 -2.720 -0.542 -0.149 -0.080 -0.061 -0.053 -0.055 -0.054 -0.043 -0.035 -0.012 0.005 -0.000 0.006 + -9.220 -3.043 -0.696 -0.165 -0.079 -0.065 -0.058 -0.050 -0.034 -0.024 -0.018 -0.010 0.020 0.025 0.038 + -9.010 -2.813 -0.626 -0.139 -0.065 -0.051 -0.047 -0.040 -0.037 -0.033 -0.019 -0.014 -0.005 0.001 0.028 + -7.216 -1.804 -0.371 -0.064 -0.024 -0.012 -0.005 -0.004 -0.002 0.008 0.010 -0.007 -0.002 0.012 0.009 + -3.544 -0.967 -0.192 -0.018 0.008 0.015 0.023 0.030 0.036 0.032 0.029 0.034 0.024 0.034 0.024 + 1.621 0.663 0.232 0.062 0.044 0.049 0.050 0.052 0.055 0.062 0.061 0.052 0.026 0.049 0.026 + 4.256 1.218 0.434 0.098 0.061 0.057 0.061 0.067 0.066 0.062 0.047 0.030 0.024 0.020 0.004 + 3.211 0.876 0.340 0.076 0.050 0.046 0.041 0.037 0.030 0.024 0.020 0.015 0.008 0.017 0.005 + 2.230 0.554 0.269 0.067 0.039 0.033 0.034 0.030 0.029 0.019 0.012 -0.001 -0.011 -0.011 0.031 + 1.281 0.285 0.165 0.060 0.044 0.041 0.039 0.036 0.032 0.028 0.017 0.006 0.011 0.007 0.011 + 1.042 0.241 0.144 0.063 0.050 0.046 0.045 0.042 0.031 0.023 0.021 0.024 0.021 0.007 0.004 + 0.985 0.225 0.128 0.064 0.052 0.049 0.048 0.046 0.044 0.042 0.033 0.018 0.004 -0.026 -0.035 + 0.992 0.218 0.103 0.060 0.049 0.049 0.047 0.047 0.046 0.040 0.022 0.016 -0.009 -0.030 -0.017 + 0.915 0.283 0.111 0.072 0.060 0.054 0.053 0.052 0.040 0.024 0.022 0.017 0.003 0.007 -0.020 + 1.165 0.391 0.124 0.095 0.086 0.080 0.068 0.054 0.048 0.032 0.023 0.037 0.011 -0.016 -0.055 + 0.664 0.222 0.073 0.053 0.042 0.032 0.024 0.019 0.037 0.050 0.038 0.021 -0.009 -0.045 -0.042 + -0.699 -62.444 0.011 -249.709 -62.396 0.033 0.022 0.002 -0.014 -0.031 -0.037 -0.037 -0.045 -0.018 -187.325 + 0.001 -62.330 0.028 -249.720 -437.045 -499.487 -499.488 -499.489 -499.491 -499.493 -499.495 -499.495 -499.512 -499.519 -561.938 + -0.366 -0.393 -0.588 -0.177 -0.095 -0.104 -0.126 -499.542 -0.063 -0.060 -0.061 -124.914 -499.540 -499.554 -374.458 + -0.198 -0.308 -0.540 -0.162 -0.096 -0.115 -0.123 -0.125 -0.111 -0.098 -0.067 -0.053 -0.038 -0.048 0.182 + -0.523 -0.229 -0.370 -0.131 -0.084 -0.067 -0.061 -0.059 -0.081 -0.090 -0.079 -0.063 -0.005 0.013 0.053 + 0.958 0.171 0.014 -0.021 -0.025 -0.030 -0.037 -0.038 -0.035 -0.029 -0.012 0.005 0.011 0.028 0.046 + 1.920 0.493 0.302 0.052 0.015 0.001 -0.006 -0.012 -0.012 -0.009 -0.013 -0.006 0.013 0.031 0.040 + 2.835 0.795 0.455 0.075 0.021 0.008 -0.001 -0.007 -0.011 -0.010 -0.008 -0.002 0.007 0.019 0.043 + 2.666 0.738 0.364 0.063 0.021 0.012 0.006 0.003 -0.001 -0.005 -0.003 0.003 0.007 0.024 0.036 + 3.110 0.898 0.490 0.076 0.027 0.017 0.011 0.009 0.007 0.010 0.010 0.015 0.026 0.041 0.044 + 3.643 1.008 0.414 0.060 0.023 0.019 0.013 0.007 0.006 0.007 0.014 0.023 0.024 0.025 0.027 + 4.113 1.215 0.497 0.068 0.027 0.018 0.015 0.016 0.017 0.016 0.018 0.014 0.016 0.022 0.031 + 6.796 1.889 0.732 0.101 0.043 0.035 0.034 0.035 0.030 0.022 0.020 0.018 0.017 0.022 0.031 + 12.695 3.898 1.380 0.221 0.117 0.099 0.085 0.073 0.059 0.052 0.037 0.028 0.025 0.009 0.023 + 21.464 6.808 2.193 0.357 0.192 0.165 0.149 0.127 0.106 0.092 0.074 0.045 0.019 -0.025 -0.019 + 25.838 8.642 2.679 0.487 0.264 0.227 0.205 0.187 0.177 0.146 0.127 0.083 0.041 -0.013 -0.016 + 21.015 7.860 2.216 0.417 0.270 0.246 0.215 0.184 0.164 0.157 0.134 0.087 0.060 0.000 -0.065 + 7.822 2.709 0.657 0.171 0.127 0.119 0.120 0.123 0.116 0.092 0.070 0.060 0.042 0.011 -0.040 + -3.300 -1.050 -0.153 -0.033 -0.023 -0.017 -0.022 -0.023 -0.018 -0.018 -0.026 -0.016 0.011 -0.013 -0.074 + -6.332 -2.552 -0.552 -0.109 -0.055 -0.049 -0.041 -0.035 -0.032 -0.026 -0.011 0.007 0.017 -0.005 -0.008 + -8.749 -2.517 -0.421 -0.075 -0.038 -0.024 -0.023 -0.019 -0.007 0.000 -0.006 0.003 0.016 0.007 -0.014 + -6.871 -2.060 -0.445 -0.117 -0.074 -0.071 -0.064 -0.059 -0.059 -0.048 -0.034 -0.021 -0.009 -0.004 -0.008 + -6.704 -2.595 -0.666 -0.154 -0.065 -0.052 -0.041 -0.042 -0.035 -0.034 -0.023 -0.009 -0.016 -0.011 -0.010 + -6.659 -1.995 -0.364 -0.069 -0.027 -0.022 -0.023 -0.020 -0.026 -0.027 -0.024 -0.028 -0.037 0.007 -0.010 + -4.350 -1.184 -0.220 -0.017 0.002 0.004 0.010 0.007 -0.004 -0.005 -0.015 -0.030 -0.026 -0.020 -0.002 + 1.289 0.287 0.062 0.029 0.026 0.020 0.012 0.008 0.006 0.004 0.002 -0.004 -0.016 -0.002 -0.018 + 3.724 1.142 0.325 0.073 0.033 0.032 0.032 0.028 0.022 0.011 0.001 -0.015 -0.032 -0.013 -0.014 + 5.652 1.518 0.457 0.075 0.034 0.031 0.029 0.024 0.015 0.002 -0.010 -0.028 -0.045 -0.020 -0.023 + 3.456 0.729 0.152 0.017 0.006 0.002 -0.002 -0.012 -0.018 -0.026 -0.032 -0.037 -0.051 -0.052 -0.024 + 0.693 0.137 0.026 -0.005 -0.007 -0.009 -0.011 -0.012 -0.018 -0.026 -0.031 -0.029 -0.019 -0.022 -0.028 + 1.773 0.382 0.140 0.029 0.016 0.012 0.010 0.011 0.006 -0.000 -0.007 -0.015 -0.015 -0.030 -0.014 + 1.827 0.397 0.194 0.045 0.028 0.028 0.033 0.031 0.026 0.023 0.022 0.011 0.004 -0.021 -0.028 + 2.021 0.457 0.220 0.065 0.046 0.045 0.048 0.050 0.052 0.051 0.039 0.030 0.010 -0.012 -0.027 + 1.580 0.353 0.166 0.061 0.049 0.049 0.048 0.051 0.051 0.048 0.041 0.042 0.017 -0.025 -0.059 + 1.328 0.323 0.149 0.098 0.079 0.077 0.074 0.064 0.052 0.030 0.015 -0.010 -0.057 -0.075 -0.108 + 0.759 0.255 0.103 0.075 0.063 0.060 0.061 0.059 0.054 0.038 0.021 0.013 0.010 -0.019 -0.108 + 0.748 0.459 0.288 0.106 0.082 0.054 0.032 0.009 -0.010 0.048 0.024 0.017 -0.017 -0.109 -0.131 + 0.532 0.183 0.051 0.063 0.061 0.041 0.059 0.035 0.045 0.031 0.005 -0.025 -0.046 -187.384 -187.438 +-374.422 -499.439 -499.467 -499.460 -499.477 0.123 0.138 0.161 -499.473 -499.471 -0.080 -0.090 -499.529 -686.820 -561.938 +-375.153 -374.908 -0.576 -0.163 -374.664 -499.519 -499.527 -499.533 -499.533 -0.121 -0.123 -0.108 -0.109 -499.532 -374.635 + 0.121 -0.123 -0.305 -0.103 -0.063 -0.067 -0.079 -0.094 -0.107 -0.112 -0.117 -0.116 -0.124 -0.100 -0.058 + -0.488 -0.293 -0.257 -0.073 -0.069 -0.087 -0.104 -0.096 -0.085 -0.090 -0.081 -0.080 -0.064 -0.058 -0.021 + 1.174 0.260 0.061 -0.017 -0.016 -0.023 -0.025 -0.037 -0.041 -0.044 -0.036 -0.033 -0.032 -0.022 -0.001 + 2.258 0.616 0.452 0.085 0.029 0.014 0.003 -0.009 -0.019 -0.024 -0.030 -0.027 -0.012 0.016 0.031 + 4.256 1.343 0.935 0.178 0.063 0.043 0.027 0.018 0.008 0.005 0.001 -0.004 -0.006 -0.008 0.003 + 3.827 1.225 0.825 0.164 0.062 0.047 0.040 0.033 0.028 0.026 0.019 0.017 0.016 0.020 0.013 + 3.695 1.172 0.742 0.133 0.050 0.039 0.033 0.024 0.019 0.018 0.019 0.019 0.013 0.014 0.014 + 3.275 0.891 0.476 0.073 0.022 0.016 0.010 0.010 0.010 0.007 0.004 0.005 0.005 0.009 0.007 + 2.827 0.848 0.417 0.064 0.024 0.017 0.015 0.008 0.007 0.004 0.006 0.003 -0.003 -0.004 0.005 + 4.915 1.405 0.715 0.101 0.037 0.033 0.026 0.024 0.020 0.018 0.003 -0.006 -0.009 0.001 0.002 + 9.402 2.796 1.321 0.188 0.086 0.082 0.081 0.073 0.057 0.041 0.036 0.026 0.017 -0.013 0.004 + 15.594 5.263 2.298 0.366 0.179 0.156 0.142 0.131 0.115 0.106 0.075 0.040 0.011 0.006 -0.006 + 20.877 7.599 3.364 0.532 0.269 0.230 0.205 0.184 0.166 0.131 0.094 0.083 0.056 -0.009 -0.037 + 19.812 7.470 2.946 0.535 0.285 0.236 0.228 0.201 0.175 0.146 0.122 0.105 0.072 -0.045 -0.089 + 11.002 4.727 1.512 0.284 0.159 0.155 0.139 0.114 0.113 0.130 0.124 0.114 0.100 0.068 -0.004 + 1.311 0.471 -0.058 -0.036 -0.041 -0.028 -0.014 0.007 0.013 0.008 0.006 -0.001 -0.009 -0.018 -0.029 + -8.711 -3.416 -0.699 -0.116 -0.036 -0.019 -0.009 0.000 0.013 0.007 0.015 0.023 0.027 0.040 -0.009 + -12.718 -4.094 -0.829 -0.154 -0.062 -0.039 -0.028 -0.022 -0.016 -0.012 -0.018 -0.018 -0.007 0.094 -0.004 + -5.904 -2.341 -0.556 -0.132 -0.084 -0.082 -0.078 -0.072 -0.074 -0.069 -0.053 -0.038 -0.002 0.014 -0.032 + -0.536 -0.249 -0.343 -0.113 -0.052 -0.037 -0.032 -0.027 -0.025 -0.017 -0.014 -0.014 -0.009 -0.025 -0.045 + -1.545 -0.508 0.025 0.008 0.004 0.002 -0.009 -0.012 -0.020 -0.033 -0.041 -0.049 -0.048 -0.063 -0.047 + 0.681 0.690 0.341 0.085 0.032 0.015 0.003 -0.007 -0.017 -0.030 -0.038 -0.044 -0.068 -0.055 -0.042 + 2.290 0.759 0.198 0.029 0.017 0.016 0.015 0.010 0.002 0.003 0.000 -0.021 -0.047 -0.057 -0.046 + 1.788 0.724 0.254 0.051 0.014 0.010 0.004 -0.001 -0.008 -0.022 -0.033 -0.044 -0.060 -0.029 -0.015 + -1.046 -0.589 -0.295 -0.079 -0.035 -0.034 -0.038 -0.045 -0.059 -0.067 -0.072 -0.072 -0.055 -0.024 -0.011 + -1.896 -0.953 -0.400 -0.087 -0.040 -0.039 -0.040 -0.039 -0.039 -0.039 -0.040 -0.042 -0.048 -0.023 -0.014 + -0.536 -0.211 -0.130 -0.031 -0.012 -0.009 -0.008 -0.011 -0.015 -0.019 -0.023 -0.024 -0.031 -0.014 0.002 + 1.813 0.570 0.189 0.021 0.006 0.005 0.004 0.002 0.000 -0.003 -0.001 -0.006 -0.013 -0.006 -0.006 + 2.408 0.512 0.226 0.052 0.027 0.023 0.021 0.016 0.013 0.013 0.009 -0.005 -0.009 -0.023 -0.021 + 3.140 0.805 0.343 0.083 0.053 0.051 0.054 0.047 0.045 0.036 0.011 0.007 0.004 -0.016 -0.037 + 2.414 0.508 0.261 0.101 0.065 0.059 0.061 0.064 0.062 0.057 0.049 0.035 0.013 -0.033 -0.080 + 1.679 0.391 0.191 0.105 0.086 0.076 0.070 0.066 0.056 0.048 0.038 0.003 -0.034 -0.093 -0.144 + 0.577 0.124 0.107 0.078 0.070 0.078 0.080 0.075 0.048 0.025 -0.026 -0.043 -0.058 -0.111 -0.210 + 0.604 0.140 0.071 0.076 0.054 0.036 0.028 0.003 -0.017 -0.036 -0.042 -0.046 -0.042 -0.093 -0.165 + -0.251 0.002 0.035 0.043 0.030 0.017 0.008 -0.010 0.006 -0.036 -0.029 -0.035 -0.087 0.060 -437.020 + 0.106 0.127 0.042 0.056 -124.828 -124.830 -499.484 -499.504 -499.518 -374.674 -0.105 -499.507 -499.465 -499.421 -561.938 + -1.912 -0.745 -375.082 -499.545 -499.521 -499.520 -0.074 -0.078 -0.094 -499.527 -499.527 -499.521 -499.512 -499.529 -561.938 + -0.838 -0.556 -0.566 -0.166 -0.106 -0.109 -0.096 -0.091 -0.072 -0.070 -0.092 -0.090 -0.098 -0.076 -187.340 + 0.361 0.169 0.109 0.003 -0.006 -0.020 -0.037 -0.042 -0.057 -0.057 -0.044 -0.042 -0.033 -0.023 0.003 + 1.354 0.234 0.078 -0.007 -0.007 -0.004 0.002 -0.004 -0.011 -0.021 -0.027 -0.020 -0.013 0.004 0.018 + 4.133 1.239 0.958 0.197 0.055 0.036 0.018 0.006 0.004 0.001 0.001 -0.004 -0.010 -0.008 0.002 + 4.337 1.344 1.006 0.208 0.082 0.063 0.051 0.039 0.024 0.012 0.002 -0.003 -0.005 -0.007 -0.012 + 4.328 1.360 1.061 0.212 0.086 0.066 0.058 0.050 0.042 0.036 0.028 0.020 0.009 -0.003 -0.015 + 3.927 1.301 0.950 0.174 0.067 0.056 0.050 0.041 0.040 0.034 0.032 0.020 0.004 -0.010 -0.005 + 2.251 0.592 0.385 0.055 0.017 0.011 0.010 0.007 0.002 -0.002 -0.004 -0.004 -0.007 -0.016 -0.021 + 2.130 0.659 0.437 0.070 0.019 0.014 0.009 0.003 -0.001 -0.009 -0.012 -0.020 -0.026 -0.028 -0.026 + 3.637 1.017 0.471 0.071 0.016 0.009 0.006 -0.002 -0.007 -0.009 -0.013 -0.021 -0.018 -0.012 -0.003 + 7.422 2.090 1.076 0.176 0.070 0.058 0.050 0.045 0.036 0.021 0.004 -0.005 -0.014 -0.010 -0.019 + 10.835 3.628 1.820 0.258 0.102 0.088 0.078 0.066 0.055 0.040 0.025 0.010 -0.003 -0.025 -0.013 + 17.863 6.618 3.304 0.556 0.209 0.168 0.143 0.123 0.103 0.082 0.060 0.033 0.014 -0.016 -0.014 + 16.709 6.632 2.882 0.506 0.203 0.171 0.156 0.142 0.125 0.113 0.100 0.085 0.047 0.022 0.012 + 5.948 2.890 1.167 0.245 0.121 0.096 0.088 0.084 0.084 0.080 0.063 0.054 0.048 0.048 0.045 + -3.866 -1.600 -0.376 -0.066 -0.026 -0.019 -0.006 -0.008 -0.011 -0.012 -0.003 0.001 0.008 0.031 0.059 + -8.382 -3.074 -0.595 -0.095 -0.038 -0.025 -0.019 -0.019 -0.020 -0.014 -0.024 -0.022 0.006 0.101 0.004 + -9.449 -3.053 -0.811 -0.136 -0.041 -0.036 -0.041 -0.049 -0.038 -0.041 -0.033 -0.005 0.038 0.058 -0.034 + -5.398 -2.377 -0.723 -0.214 -0.117 -0.095 -0.075 -0.075 -0.068 -0.053 -0.034 -0.033 -0.027 0.006 -0.041 + -1.644 -1.077 -0.474 -0.121 -0.036 -0.028 -0.034 -0.039 -0.034 -0.026 -0.021 -0.013 -0.007 -0.001 -0.038 + -0.277 0.204 0.232 0.097 0.018 0.006 0.012 0.018 0.011 0.013 0.000 -0.008 -0.025 -0.055 -0.034 + 3.227 1.059 0.354 -0.006 -0.012 -0.004 -0.008 -0.012 -0.016 -0.022 -0.023 -0.021 -0.031 -0.044 -0.032 + 3.540 1.378 0.604 0.142 0.040 0.010 0.000 -0.004 -0.000 0.002 -0.002 -0.019 -0.014 -0.018 -0.020 + 1.218 0.209 -0.008 -0.004 -0.006 -0.007 -0.010 -0.012 -0.017 -0.022 -0.020 -0.016 -0.020 -0.006 -0.010 + -1.336 -0.832 -0.312 -0.077 -0.032 -0.031 -0.034 -0.038 -0.036 -0.036 -0.032 -0.024 -0.005 0.016 0.008 + -1.244 -0.339 -0.212 -0.045 -0.028 -0.024 -0.026 -0.029 -0.031 -0.030 -0.022 -0.010 -0.009 0.006 0.030 + -0.106 -0.176 -0.114 -0.025 -0.007 -0.006 -0.001 -0.000 0.001 0.002 0.005 0.002 -0.008 0.010 0.012 + 2.104 0.643 0.297 0.060 0.026 0.019 0.017 0.013 0.007 0.003 -0.013 -0.020 -0.008 0.008 0.016 + 3.544 0.997 0.552 0.100 0.048 0.042 0.040 0.031 0.012 0.010 0.013 0.011 0.008 -0.005 -0.014 + 3.324 0.797 0.490 0.106 0.055 0.049 0.051 0.051 0.060 0.054 0.050 0.036 0.013 -0.011 -0.037 + 3.534 0.775 0.433 0.137 0.081 0.075 0.074 0.073 0.066 0.056 0.045 0.024 0.005 -0.029 -0.028 + 2.778 0.698 0.359 0.147 0.095 0.087 0.083 0.079 0.074 0.055 0.039 0.018 0.003 -0.037 -0.043 + 1.518 0.366 0.218 0.103 0.080 0.081 0.048 0.040 0.029 0.026 0.029 0.012 -0.015 -0.082 -0.079 + 0.663 0.129 0.059 0.022 0.024 0.014 0.023 0.040 0.040 0.029 0.001 -0.056 -0.066 -0.106 -0.261 + 0.095 -249.794 -249.761 0.080 0.028 0.041 0.027 0.004 0.001 0.007 0.006 -0.017 -0.051 -0.135 -437.177 +-375.348 -749.250 -749.250 -499.468 -499.475 -499.472 -499.487 -499.503 -499.511 -0.043 -0.056 -374.648 -499.503 -499.601 -561.938 +-375.026 -499.704 -499.713 -499.543 -499.517 -499.522 -499.515 -499.513 -0.133 -0.123 -124.960 -499.514 -499.515 -686.811 -561.938 + -0.224 -0.176 -0.283 -0.076 -0.035 -0.039 -0.048 -0.060 -0.064 -0.084 -0.101 -0.091 -0.080 -187.329 -187.321 + 1.296 0.332 0.100 -0.007 -0.020 -0.022 -0.033 -0.050 -0.062 -0.063 -0.029 -0.057 -0.048 -0.043 -0.008 + 1.091 0.221 0.199 0.007 -0.017 -0.024 -0.027 -0.023 -0.038 -0.042 -0.044 -0.041 -0.055 -0.043 -0.019 + 2.969 0.876 0.735 0.158 0.067 0.050 0.042 0.029 0.030 0.017 0.005 -0.013 -0.022 -0.012 -0.008 + 4.443 1.451 1.216 0.254 0.114 0.099 0.085 0.071 0.045 0.031 0.014 0.000 -0.013 -0.015 -0.035 + 4.684 1.545 1.274 0.247 0.102 0.081 0.073 0.068 0.058 0.039 0.025 0.015 0.004 -0.024 -0.034 + 3.590 1.128 0.844 0.166 0.069 0.058 0.052 0.041 0.032 0.021 0.007 -0.002 -0.016 -0.041 -0.055 + 2.724 0.828 0.556 0.109 0.040 0.034 0.027 0.020 0.014 0.009 0.006 -0.002 -0.024 -0.036 -0.045 + 2.510 0.894 0.602 0.089 0.021 0.010 0.010 0.005 -0.001 -0.005 -0.018 -0.027 -0.038 -0.048 -0.049 + 3.631 0.967 0.506 0.071 0.018 0.013 0.006 0.005 -0.002 -0.011 -0.017 -0.026 -0.030 -0.025 -0.026 + 6.562 1.918 1.132 0.172 0.047 0.031 0.024 0.017 0.014 0.013 0.009 0.010 0.002 0.000 0.000 + 10.122 3.529 1.832 0.306 0.099 0.073 0.066 0.055 0.046 0.032 0.028 0.016 0.012 0.010 0.013 + 14.121 5.179 2.712 0.463 0.162 0.124 0.103 0.084 0.071 0.062 0.049 0.042 0.026 0.029 0.020 + 10.540 4.330 2.205 0.399 0.145 0.111 0.103 0.097 0.088 0.078 0.074 0.061 0.050 0.046 0.031 + 5.227 2.373 0.962 0.170 0.061 0.048 0.038 0.033 0.035 0.037 0.036 0.037 0.031 0.034 0.026 + -3.642 -1.662 -0.497 -0.132 -0.058 -0.052 -0.037 -0.034 -0.025 -0.021 -0.016 -0.008 0.010 0.038 0.031 + -9.107 -3.135 -0.675 -0.122 -0.054 -0.023 -0.027 -0.026 -0.019 -0.016 -0.010 -0.002 0.010 0.024 0.025 + -9.451 -3.250 -0.627 -0.096 -0.037 -0.042 -0.028 -0.028 -0.026 -0.032 -0.022 -0.018 -0.002 0.024 0.042 + -6.722 -2.316 -0.770 -0.211 -0.102 -0.088 -0.084 -0.085 -0.077 -0.060 -0.059 -0.045 -0.027 0.001 0.004 + -3.090 -1.195 -0.452 -0.098 -0.031 -0.028 -0.027 -0.027 -0.021 -0.011 -0.011 -0.009 -0.007 -0.024 -0.015 + 2.799 0.995 0.658 0.158 0.033 0.014 0.021 0.017 0.015 0.007 0.006 0.013 -0.011 -0.016 -0.049 + 3.807 1.436 0.381 0.035 0.008 0.016 0.021 0.012 0.003 0.004 0.015 -0.002 -0.016 -0.038 -0.024 + -0.020 -0.194 0.147 0.073 0.019 0.007 0.002 0.005 0.015 0.013 0.000 -0.004 -0.003 -0.034 -0.010 + 1.105 0.234 0.146 0.018 -0.006 -0.010 -0.008 -0.006 -0.007 -0.005 -0.008 -0.013 -0.017 -0.010 0.016 + 0.923 0.077 -0.121 -0.040 -0.022 -0.023 -0.024 -0.028 -0.029 -0.029 -0.026 -0.020 -0.018 -0.033 0.010 + -0.447 -0.157 -0.148 -0.034 -0.016 -0.011 -0.011 -0.013 -0.014 -0.014 -0.014 -0.018 -0.002 -0.048 0.034 + 0.383 -0.021 -0.018 -0.001 0.008 0.007 0.010 0.009 0.011 0.007 -0.004 0.002 -0.044 -0.017 0.013 + 2.539 0.841 0.477 0.096 0.041 0.031 0.032 0.026 0.020 0.026 0.014 -0.022 -0.004 0.004 -0.034 + 4.179 1.241 0.705 0.123 0.057 0.051 0.047 0.045 0.029 0.016 0.004 0.015 -0.004 -0.004 -0.066 + 4.341 1.099 0.689 0.129 0.065 0.053 0.047 0.039 0.030 0.030 0.022 -0.001 -0.005 -0.011 -0.067 + 2.953 0.674 0.370 0.119 0.064 0.062 0.062 0.056 0.044 0.027 0.024 0.011 0.002 -0.047 -0.069 + 3.334 0.868 0.499 0.140 0.099 0.083 0.082 0.074 0.071 0.066 0.043 0.007 -0.032 -0.049 -0.044 + 2.079 0.567 0.278 0.123 0.070 0.063 0.051 0.048 0.039 0.023 0.017 0.004 -0.010 -0.064 -0.005 + 1.133 0.080 0.034 0.024 0.028 0.027 0.030 0.021 0.010 0.002 -0.001 -0.002 -0.023 -0.032 -124.844 + 0.360 -62.392 -187.301 0.002 0.005 0.008 0.002 0.002 0.011 0.031 0.056 0.046 0.037 -249.652 -561.859 +-374.620 -561.948 -686.805 -499.508 -499.505 -499.502 -499.499 -499.496 -499.492 -499.486 -499.483 -499.470 -499.455 -749.250 -561.938 + -1.623 -0.746 -250.428 -0.254 -0.119 -0.106 -124.964 -499.530 -499.529 -499.528 -499.537 -499.538 -499.544 -499.535 -374.645 + -0.563 -0.255 -249.949 -0.141 -0.069 -0.060 -0.056 -0.106 -0.107 -0.140 -0.149 -0.135 -0.073 -0.048 -374.666 + 2.931 0.643 0.289 0.021 -0.020 -0.029 -0.053 -0.022 -0.026 -0.032 -0.031 -0.054 -0.054 -0.054 -0.048 + 2.402 0.716 0.631 0.129 0.072 0.048 0.036 0.020 0.034 0.029 0.041 0.043 0.026 0.010 -0.014 + 3.597 0.849 0.753 0.169 0.052 0.058 0.054 0.063 0.036 0.037 0.013 0.032 0.013 -0.021 -0.066 + 4.359 1.432 1.169 0.226 0.095 0.081 0.076 0.061 0.053 0.035 0.007 -0.019 -0.046 -0.096 -0.102 + 3.344 1.013 0.872 0.177 0.078 0.067 0.067 0.059 0.053 0.042 0.031 0.006 -0.018 -0.029 -0.042 + 3.494 1.166 0.923 0.184 0.072 0.063 0.050 0.042 0.037 0.028 0.030 0.009 -0.007 -0.033 -0.043 + 2.666 0.842 0.562 0.099 0.029 0.027 0.026 0.028 0.023 0.017 0.003 -0.005 -0.020 -0.036 -0.037 + 2.371 0.671 0.561 0.111 0.043 0.032 0.030 0.022 0.013 0.007 -0.002 -0.008 -0.019 -0.028 -0.029 + 3.973 1.280 0.824 0.122 0.024 0.014 0.006 0.004 -0.001 -0.009 -0.011 -0.015 -0.019 -0.019 -0.010 + 6.651 2.047 1.159 0.187 0.047 0.032 0.025 0.018 0.017 0.008 0.014 0.008 -0.001 -0.009 0.004 + 10.481 3.333 1.871 0.329 0.108 0.082 0.083 0.073 0.064 0.070 0.056 0.052 0.037 0.029 0.030 + 13.649 5.054 2.995 0.485 0.162 0.124 0.110 0.099 0.089 0.075 0.067 0.068 0.049 0.052 0.057 + 9.792 4.492 2.302 0.419 0.154 0.120 0.125 0.105 0.099 0.104 0.086 0.084 0.063 0.077 0.020 + 6.899 2.848 1.255 0.169 0.070 0.065 0.063 0.055 0.052 0.043 0.038 0.031 0.032 0.036 0.030 + 1.733 0.124 -0.115 -0.022 -0.019 -0.018 -0.010 -0.010 -0.019 -0.022 -0.010 -0.004 -0.003 0.039 0.010 + -8.022 -3.172 -0.783 -0.118 -0.057 -0.037 -0.037 -0.023 -0.023 -0.025 -0.026 -0.016 -0.008 0.010 0.003 + -11.657 -3.532 -0.807 -0.158 -0.056 -0.036 -0.028 -0.037 -0.039 -0.039 -0.029 -0.032 -0.050 -0.038 -0.001 + -6.321 -2.167 -0.520 -0.103 -0.027 -0.026 -0.031 -0.043 -0.041 -0.040 -0.043 -0.026 -0.045 -0.036 -0.035 + -0.895 -1.090 -0.299 0.014 0.009 0.007 -0.003 -0.003 -0.006 -0.020 -0.027 -0.025 -0.014 -0.012 -0.013 + -3.264 0.056 0.447 0.156 0.071 0.060 0.046 0.036 0.031 0.039 0.048 0.047 0.038 -0.002 -0.053 + 4.510 1.877 0.824 0.194 0.062 0.046 0.045 0.050 0.060 0.061 0.046 0.030 0.033 -0.021 -0.035 + 5.300 1.911 0.988 0.156 0.036 0.028 0.030 0.029 0.026 0.018 0.004 -0.002 -0.017 -0.040 -0.016 + 3.338 0.945 0.308 0.041 -0.003 -0.012 -0.013 -0.023 -0.029 -0.024 -0.013 -0.024 -0.035 -0.072 0.001 + 1.151 0.809 0.583 0.099 0.016 -0.002 -0.014 -0.019 -0.022 -0.028 -0.041 -0.039 -0.053 -0.082 -0.006 + -1.404 -0.630 -0.378 -0.082 -0.038 -0.040 -0.042 -0.042 -0.044 -0.040 -0.039 -0.056 -0.066 -0.036 -0.025 + 0.906 0.182 0.109 0.006 0.016 0.016 0.007 -0.003 -0.008 -0.032 -0.038 -0.028 -0.026 -0.033 -0.015 + 2.603 0.680 0.400 0.079 0.025 0.016 0.006 -0.006 -0.006 -0.003 0.004 0.019 0.007 0.025 -0.076 + 3.550 0.950 0.717 0.139 0.055 0.041 0.046 0.048 0.039 0.020 0.023 0.032 -0.013 -0.041 -0.142 + 5.392 1.398 0.952 0.197 0.086 0.079 0.074 0.068 0.065 0.054 0.035 0.010 -0.032 -0.052 -0.154 + 3.668 0.903 0.621 0.190 0.108 0.108 0.105 0.118 0.116 0.118 0.095 0.084 0.041 -0.040 -0.118 + 4.019 0.879 0.440 0.198 0.132 0.132 0.145 0.175 0.141 0.116 0.110 0.051 0.007 0.062 -0.057 + 3.287 0.731 0.305 0.098 0.064 0.057 0.046 0.032 0.027 0.008 0.014 0.037 0.020 -0.005 -124.941 + 1.338 0.414 0.204 0.074 0.045 0.042 0.050 0.067 0.068 0.054 -0.020 -0.067 -0.025 -0.054 -499.561 +-374.240 -499.406 -499.442 -499.497 -499.505 -499.490 -499.489 0.004 0.004 -0.008 0.007 -0.005 -124.929 -249.889 -562.028 +-374.438 0.043 0.016 0.026 0.029 -499.493 -499.494 -499.481 -499.481 -499.483 -499.515 -499.523 -499.530 -749.250 -561.938 \ No newline at end of file diff --git a/observations/gps/work/path_names_convert_cosmic_gps_cdf b/observations/gps/work/path_names_convert_cosmic_gps_cdf index 99f7c78904..cd87c133c9 100644 --- a/observations/gps/work/path_names_convert_cosmic_gps_cdf +++ b/observations/gps/work/path_names_convert_cosmic_gps_cdf @@ -1,6 +1,5 @@ adaptive_inflate/adaptive_inflate_mod.f90 assim_model/assim_model_mod.f90 -assim_tools/assim_tools_mod.f90 common/types_mod.f90 cov_cutoff/cov_cutoff_mod.f90 ensemble_manager/ensemble_manager_mod.f90 diff --git a/observations/gps/work/path_names_convert_cosmic_iono_cdf b/observations/gps/work/path_names_convert_cosmic_iono_cdf new file mode 100644 index 0000000000..4d8d95b0f1 --- /dev/null +++ b/observations/gps/work/path_names_convert_cosmic_iono_cdf @@ -0,0 +1,19 @@ +adaptive_inflate/adaptive_inflate_mod.f90 +assim_model/assim_model_mod.f90 +common/types_mod.f90 +cov_cutoff/cov_cutoff_mod.f90 +ensemble_manager/ensemble_manager_mod.f90 +location/threed_sphere/location_mod.f90 +models/template/model_mod.f90 +mpi_utilities/null_mpi_utilities_mod.f90 +obs_def/obs_def_mod.f90 +obs_kind/obs_kind_mod.f90 +obs_model/obs_model_mod.f90 +obs_sequence/obs_sequence_mod.f90 +observations/gps/convert_cosmic_iono_cdf.f90 +observations/utilities/obs_utilities_mod.f90 +random_seq/random_seq_mod.f90 +reg_factor/reg_factor_mod.f90 +sort/sort_mod.f90 +time_manager/time_manager_mod.f90 +utilities/utilities_mod.f90 diff --git a/observations/gps/work/path_names_convert_cosmic_ionosphere b/observations/gps/work/path_names_convert_cosmic_ionosphere index 5293a3090b..6622eac974 100644 --- a/observations/gps/work/path_names_convert_cosmic_ionosphere +++ b/observations/gps/work/path_names_convert_cosmic_ionosphere @@ -1,6 +1,5 @@ adaptive_inflate/adaptive_inflate_mod.f90 assim_model/assim_model_mod.f90 -assim_tools/assim_tools_mod.f90 common/types_mod.f90 cov_cutoff/cov_cutoff_mod.f90 ensemble_manager/ensemble_manager_mod.f90 diff --git a/observations/ok_mesonet/convert_ok_mesonet.f90 b/observations/ok_mesonet/convert_ok_mesonet.f90 index da8881a626..133497a74b 100644 --- a/observations/ok_mesonet/convert_ok_mesonet.f90 +++ b/observations/ok_mesonet/convert_ok_mesonet.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program convert_ok_mesonet @@ -401,8 +399,3 @@ subroutine get_geo(search_stid,nlat,nlon,elevf) close(iunit) end subroutine get_geo -! -! $URL$ -! $Revision$ -! $Date$ - diff --git a/observations/text_GITM/work/input.nml b/observations/text_GITM/work/input.nml index ff9d44bead..4be81a41c2 100644 --- a/observations/text_GITM/work/input.nml +++ b/observations/text_GITM/work/input.nml @@ -1,10 +1,10 @@ &preprocess_nml - input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90', - output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90', - input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90', - output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90', - input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' + input_obs_kind_mod_file = '../../../obs_kind/DEFAULT_obs_kind_mod.F90' + output_obs_kind_mod_file = '../../../obs_kind/obs_kind_mod.f90' + input_obs_def_mod_file = '../../../obs_def/DEFAULT_obs_def_mod.F90' + output_obs_def_mod_file = '../../../obs_def/obs_def_mod.f90' + input_files = '../../../obs_def/obs_def_upper_atm_mod.f90' / &obs_kind_nml @@ -50,13 +50,13 @@ &location_nml - horiz_dist_only = .false., - vert_normalization_pressure = 100000.0, - vert_normalization_height = 100000.0, - vert_normalization_level = 20.0, - approximate_distance = .false., - nlon = 71, - nlat = 36, + horiz_dist_only = .false. + vert_normalization_pressure = 100000.0 + vert_normalization_height = 100000.0 + vert_normalization_level = 20.0 + approximate_distance = .false. + nlon = 71 + nlat = 36 output_box_info = .true. / diff --git a/observations/utilities/obs_utilities_mod.f90 b/observations/utilities/obs_utilities_mod.f90 index 1dab2a4696..bfc711fd38 100644 --- a/observations/utilities/obs_utilities_mod.f90 +++ b/observations/utilities/obs_utilities_mod.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module obs_utilities_mod @@ -40,6 +38,8 @@ module obs_utilities_mod get_or_fill_QC, & getvar_real_2d, & getvar_int_2d, & + getvar_real_3d, & + getvar_int_3d, & getvar_real_1d_1val, & getvar_int_1d_1val, & getvar_real_2d_slice, & @@ -52,10 +52,9 @@ module obs_utilities_mod character(len=NF90_MAX_NAME) :: missing_name = '' ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'obs_utilities_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' contains @@ -869,6 +868,163 @@ subroutine getvar_int_2d(ncid, varname, darray, dmiss) end subroutine getvar_int_2d +!-------------------------------------------------------------------- +! +!> getvar_real_3d - subroutine that inquires, gets the variable, and fills +!> in the missing value attribute if that arg is present. +!> gets the entire array, no start or count specified. +!> this version assumes you are reading an entire 2d array. +!> see the slice versions for reading 1d from a 2d array. +!> +!> ncid - open netcdf file handle +!> varname - string name of netcdf variable +!> darray - 2d output array. real(r8) +!> dmiss - value that signals a missing value real(r8), optional +!> +!> created 11 Mar 2010, nancy collins, ncar/image +!> modified 13 Jul 2020, George Bowden, UNSW Canberra + +subroutine getvar_real_3d(ncid, varname, darray, dmiss) + integer, intent(in) :: ncid + character(len = *), intent(in) :: varname + real(r8), intent(out) :: darray(:,:,:) + real(r8), optional, intent(out) :: dmiss + +integer :: varid, nfrc +real(r8) :: fill, miss +logical :: found_miss + +! read the data for the requested array, and optionally get the fill value +call nc_check( nf90_inq_varid(ncid, varname, varid), & + 'getvar_real_3d', 'inquire var '// trim(varname)) +call nc_check( nf90_get_var(ncid, varid, darray), & + 'getvar_real_3d', 'getting var '// trim(varname)) + +! the logic here is: +! if the user hasn't asked about the fill value, don't look for any of +! these attributes and just return. + +! if the user has told us another attribute name to look for, try that first. +! it's currently NOT an error if it's not there. then second, look for the +! official '_FillValue' attr. if it's found, return it as the missing value. +! +! if there are both, overwrite the missing value with the fill value and return +! the fill value as the 'dmiss' argument. +! +! if neither are there, set dmiss to the DART missing value. this could also +! be an error, but default to being permissive for now. + +if (present(dmiss)) then + dmiss = MISSING_R8 + found_miss = .false. + + ! if user defined another attribute name for missing vals + ! look for it first, and make it an error if it's not there? + if (missing_name /= '') then + nfrc = nf90_get_att(ncid, varid, missing_name, miss) + if (nfrc == NF90_NOERR) then + found_miss = .true. + dmiss = miss + endif + endif + + ! this would make it a fatal error if not found + !call nc_check( nf90_get_att(ncid, varid, missing_name', miss), & + ! 'getvar_real_3d', 'getting attr "//trim(missing_name)//" for '//trim(varname)) + + ! the predefined netcdf fill value. + nfrc = nf90_get_att(ncid, varid, '_FillValue', fill) + if (nfrc == NF90_NOERR) then + if (.not. found_miss) then + found_miss = .true. + dmiss = fill + else + ! found both, set all to fill value + where(darray .eq. miss) darray = fill + dmiss = fill + endif + endif + + ! if you wanted an error if you specified dmiss and neither attr are + ! there, you'd test found_miss here. if it's still false, none were there. + +endif + +end subroutine getvar_real_3d + + +!-------------------------------------------------------------------- +!> +!> getvar_int_3d - subroutine that inquires, gets the variable, and fills +!> in the missing value attribute if that arg is present. +!> gets the entire array, no start or count specified. +!> this version assumes you are reading an entire 3d array. +!> see the slice versions for reading 1d from a 3d array. +!> +!> ncid - open netcdf file handle +!> varname - string name of netcdf variable +!> darray - 3d output array. integer +!> dmiss - value that signals a missing value integer, optional +!> +!> created 11 Mar 2010, nancy collins, ncar/image +!> modified 13 Jul 2020, George Bowden, UNSW Canberra + +subroutine getvar_int_3d(ncid, varname, darray, dmiss) + integer, intent(in) :: ncid + character(len = *), intent(in) :: varname + integer, intent(out) :: darray(:,:,:) + integer, optional, intent(out) :: dmiss + +integer :: varid, nfrc +real(r8) :: fill, miss +logical :: found_miss + +! read the data for the requested array, and get the fill value +call nc_check( nf90_inq_varid(ncid, varname, varid), & + 'getvar_int_3d', 'inquire var '// trim(varname)) +call nc_check( nf90_get_var(ncid, varid, darray), & + 'getvar_int_3d', 'getting var '// trim(varname)) + +! see long comment in getvar_real() about the logic here. +if (present(dmiss)) then + dmiss = MISSING_I + found_miss = .false. + + ! if user defined another attribute name for missing vals + ! look for it first, and make it an error if it's not there? + if (missing_name /= '') then + nfrc = nf90_get_att(ncid, varid, missing_name, miss) + if (nfrc == NF90_NOERR) then + found_miss = .true. + dmiss = miss + endif + endif + + ! this would make it a fatal error if not found + !call nc_check( nf90_get_att(ncid, varid, missing_name', miss), & + ! 'getvar_int_3d', 'getting attr "//trim(missing_name)//" for '//trim(varname)) + + ! the predefined netcdf fill value. + nfrc = nf90_get_att(ncid, varid, '_FillValue', fill) + if (nfrc == NF90_NOERR) then + if (.not. found_miss) then + found_miss = .true. + dmiss = fill + else + ! found both, set all to fill value + where(darray .eq. miss) darray = fill + dmiss = fill + endif + endif + + ! if you wanted an error if you specified dmiss and neither attr are + ! there, you'd test found_miss here. if it's still false, none were there. + +endif + +end subroutine getvar_int_3d + + !-------------------------------------------------------------------- !> getvar_real_1d_1val - subroutine that inquires, gets the variable, and fills !> in the missing value attribute if that arg is present. diff --git a/perfect_model_obs/perfect_model_obs.f90 b/perfect_model_obs/perfect_model_obs.f90 index 0aeb141bac..eb7c845f7b 100644 --- a/perfect_model_obs/perfect_model_obs.f90 +++ b/perfect_model_obs/perfect_model_obs.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program perfect_model_obs @@ -41,10 +39,9 @@ program perfect_model_obs implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'perfect_model_obs.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Module storage for message output character(len=129) :: msgstring @@ -633,8 +630,3 @@ end subroutine print_obs_time end program perfect_model_obs -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/preprocess/preprocess.f90 b/preprocess/preprocess.f90 index 1598441056..46a01c2d71 100644 --- a/preprocess/preprocess.f90 +++ b/preprocess/preprocess.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program preprocess @@ -27,10 +25,9 @@ program preprocess implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'preprocess.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Pick something ridiculously large and forget about it (lazy) integer, parameter :: max_types = 5000, max_kinds = 5000 @@ -726,8 +723,3 @@ end subroutine typekind_error end program preprocess -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/random_seq/random_seq_mod.f90 b/random_seq/random_seq_mod.f90 index 53b58c6160..745fb42110 100644 --- a/random_seq/random_seq_mod.f90 +++ b/random_seq/random_seq_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module random_seq_mod @@ -19,10 +17,9 @@ module random_seq_mod several_random_gaussians, random_uniform, twod_gaussians ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'random_seq_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Gives ability to generate unique repeatable sequences of random numbers ! using random congruential package. Needed to allow different assim algorithms @@ -360,8 +357,3 @@ end function ran_gauss end module random_seq_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/reg_factor/reg_factor_mod.f90 b/reg_factor/reg_factor_mod.f90 index 333938228a..2aeddb9974 100644 --- a/reg_factor/reg_factor_mod.f90 +++ b/reg_factor/reg_factor_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module reg_factor_mod @@ -19,10 +17,9 @@ module reg_factor_mod public :: comp_reg_factor ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'reg_factor_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !============================================================================ @@ -197,8 +194,3 @@ end function comp_reg_factor end module reg_factor_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/smoother/smoother_mod.f90 b/smoother/smoother_mod.f90 index 980902c0bc..7481512137 100644 --- a/smoother/smoother_mod.f90 +++ b/smoother/smoother_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module smoother_mod @@ -35,10 +33,9 @@ module smoother_mod ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'smoother_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical :: module_initialized = .false. integer :: print_trace_details = 0 @@ -651,8 +648,3 @@ end subroutine set_smoother_trace end module smoother_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/sort/sort_mod.f90 b/sort/sort_mod.f90 index 0f0892f004..bca6ac99c4 100644 --- a/sort/sort_mod.f90 +++ b/sort/sort_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module sort_mod @@ -15,10 +13,9 @@ module sort_mod public :: slow_sort, slow_index_sort, sort, index_sort ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'sort_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' logical, save :: module_initialized = .false. @@ -393,8 +390,3 @@ end subroutine index_sort_int end module sort_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/time_manager/advance_time.f90 b/time_manager/advance_time.f90 index aa5a93fe29..a4a973eb3d 100644 --- a/time_manager/advance_time.f90 +++ b/time_manager/advance_time.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ !> interface identical to WRF da_advance_cymdh, except for reading the arg line !> from standard input, to be more portable since iargc() is nonstandard across @@ -72,10 +70,9 @@ program advance_time implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'advance_time.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' integer :: ccyy, mm, dd, hh, nn, ss, dday, dh, dn, ds, gday, gsec integer :: nargum, i @@ -402,8 +399,3 @@ end function formatCESMdate end program advance_time -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/time_manager/schedule_mod.f90 b/time_manager/schedule_mod.f90 index 8b4b4105f2..a6e57d4abb 100644 --- a/time_manager/schedule_mod.f90 +++ b/time_manager/schedule_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module schedule_mod @@ -30,10 +28,9 @@ module schedule_mod !======================================================================= ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'schedule_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' type schedule_type private @@ -305,8 +302,3 @@ function get_schedule_length(schedule) end module schedule_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/time_manager/time_manager_mod.f90 b/time_manager/time_manager_mod.f90 index 004e9035b9..373276c40c 100644 --- a/time_manager/time_manager_mod.f90 +++ b/time_manager/time_manager_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module time_manager_mod @@ -88,10 +86,9 @@ module time_manager_mod public :: write_time, read_time, interactive_time ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'time_manager_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' ! Global data to define calendar type integer, parameter :: THIRTY_DAY_MONTHS = 1, JULIAN = 2, & @@ -3263,8 +3260,3 @@ end subroutine time_index_sort end module time_manager_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/utilities/model_mod_check.f90 b/utilities/model_mod_check.f90 index 8d50fd27a0..3bd0d437ee 100644 --- a/utilities/model_mod_check.f90 +++ b/utilities/model_mod_check.f90 @@ -1,8 +1,6 @@ -! DART software - Copyright 2004 - 2013 UCAR. This open source software is -! provided by UCAR, "as is", without charge, subject to all terms of use at +! DART software - Copyright UCAR. This open source software is provided +! by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program model_mod_check @@ -11,31 +9,39 @@ program model_mod_check !---------------------------------------------------------------------- use types_mod, only : r8, digits12, metadatalength + use utilities_mod, only : initialize_utilities, finalize_utilities, nc_check, & open_file, close_file, find_namelist_in_file, & check_namelist_read, error_handler, E_MSG + use location_mod, only : location_type, set_location, write_location, get_dist, & - query_location, LocationDims, get_location + query_location, LocationDims, get_location, & + set_location, VERTISUNDEF, VERTISHEIGHT, & + get_close_obs_init, get_close_maxdist_init, & + get_close_type, get_close_obs_destroy + use obs_kind_mod, only : get_raw_obs_kind_name, get_raw_obs_kind_index + use assim_model_mod, only : open_restart_read, open_restart_write, close_restart, & aread_state_restart, awrite_state_restart, & netcdf_file_type, aoutput_diagnostics, & init_diag_output, finalize_diag_output + use time_manager_mod, only : time_type, set_calendar_type, GREGORIAN, & read_time, get_time, set_time, & print_date, get_date, & print_time, write_time, & operator(-) -use model_mod, only : static_init_model, get_model_size, get_state_meta_data - ! test_interpolate, get_gridsize + +use model_mod, only : static_init_model, get_model_size, get_state_meta_data, & + ens_mean_for_model, test_interpolate, get_close_obs implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'model_mod_check.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' !------------------------------------------------------------------ ! The namelist variables @@ -44,7 +50,7 @@ program model_mod_check character (len = 129) :: input_file = 'dart_ics' character (len = 129) :: output_file = 'check_me' logical :: advance_time_present = .FALSE. -logical :: verbose = .FALSE. +logical :: verbose = .TRUE. integer :: x_ind = -1 real(r8), dimension(3) :: loc_of_interest = -1.0_r8 character(len=metadatalength) :: kind_of_interest = 'ANY' @@ -56,10 +62,8 @@ program model_mod_check !---------------------------------------------------------------------- ! integer :: numlons, numlats, numlevs -integer :: in_unit, out_unit, ios_out, iunit, io, offset +integer :: iunit, io integer :: x_size -integer :: year, month, day, hour, minute, second -integer :: secs, days type(time_type) :: model_time, adv_to_time real(r8), allocatable :: statevector(:) @@ -67,12 +71,27 @@ program model_mod_check character(len=metadatalength) :: state_meta(1) type(netcdf_file_type) :: ncFileID +type(location_type) :: loc + +! stuff to test get_close_obs() + +type(get_close_type) :: gc_type +type(location_type), dimension(:), allocatable :: my_locs +integer, dimension(:), allocatable :: my_kinds +integer, dimension(:), allocatable :: close_indices +real(r8), dimension(:), allocatable :: close_distances +integer :: num_close, base_type +real(r8) :: cutoff + !---------------------------------------------------------------------- ! This portion checks the geometry information. +! The call to set_location is just to initialize the location module; +! which causes the registration information to get printed immediately. !---------------------------------------------------------------------- call initialize_utilities(progname='model_mod_check', output_flag=verbose) call set_calendar_type(GREGORIAN) +loc = set_location(0.0_r8, 0.0_r8, 0.0_r8, VERTISUNDEF) write(*,*) write(*,*)'Reading the namelist to get the input filename.' @@ -81,9 +100,6 @@ program model_mod_check read(iunit, nml = model_mod_check_nml, iostat = io) call check_namelist_read(iunit, io, "model_mod_check_nml") -write(*,'(''Converting DART file '',A,'' to restart file '',A)') & - trim(input_file), trim(output_file) - ! This harvests all kinds of initialization information call static_init_model() @@ -134,6 +150,11 @@ program model_mod_check call print_date( model_time,'model_mod_check:model date') call print_time( model_time,'model_mod_check:model time') +! Set the ensemble mean (to a single value) so that it is available +! for the metadata/conversion routines + +call ens_mean_for_model(statevector) + !---------------------------------------------------------------------- ! Output the state vector to a netCDF file ... ! This is the same procedure used by 'perfect_model_obs' & 'filter' @@ -153,17 +174,6 @@ program model_mod_check call nc_check( finalize_diag_output(ncFileID), 'model_mod_check:main', 'finalize') -!---------------------------------------------------------------------- -! Check the interpolation - print initially to STDOUT -!---------------------------------------------------------------------- -! Use 500 mb ~ level 30 (in the 42-level version) - -!write(*,*) -!write(*,*)'Testing the interpolation ...' - -! call test_interpolate(statevector, test_pressure=500.0_r8, & -! start_lon=142.5_r8) - !---------------------------------------------------------------------- ! Checking get_state_meta_data (and get_state_indices, get_state_kind) ! nx = 144; ny=72; nz=42; produce the expected values : @@ -183,7 +193,48 @@ program model_mod_check if ( loc_of_interest(1) > 0.0_r8 ) call find_closest_gridpoint( loc_of_interest ) +!---------------------------------------------------------------------- +! Check the interpolation - print initially to STDOUT +!---------------------------------------------------------------------- +! Use 500 mb ~ level 30 (in the 42-level version) + +write(*,*) +write(*,*)'Testing the interpolation ...' + +call test_interpolate(statevector, loc_of_interest) + +!---------------------------------------------------------------------- +! Check the get_close() routines. +!---------------------------------------------------------------------- + +allocate(my_locs(x_size), my_kinds(x_size)) +allocate(close_indices(x_size), close_distances(x_size)) + +loc = set_location(loc_of_interest(1), loc_of_interest(2), loc_of_interest(3), VERTISHEIGHT) +base_type = 1 ! observation type, just use first in list (like CHAMP_NEUTRAL_DENSITY) + +do x_ind = 1,x_size + call get_state_meta_data( x_ind, my_locs(x_ind), my_kinds(x_ind)) +enddo +cutoff = 0.02 + +call get_close_maxdist_init(gc_type, 2.0_r8*cutoff) +call get_close_obs_init(gc_type, x_size, my_locs) + +call get_close_obs(gc_type, loc, base_type, my_locs, my_kinds, & + num_close, close_indices, close_distances) + +do x_ind = 1,num_close + write(*,*)'close #',x_ind, '(element', close_indices(x_ind), & + ') has distance',close_distances(x_ind),'"radians"' +enddo + +deallocate(my_locs, my_kinds, close_indices, close_distances) +call get_close_obs_destroy(gc_type) + + +!---------------------------------------------------------------------- call error_handler(E_MSG, 'model_mod_check', 'FINISHED successfully.',& source,revision,revdate) call finalize_utilities() @@ -236,7 +287,7 @@ subroutine find_closest_gridpoint( loc_of_interest ) write(*,*) write(*,'(''Checking for the indices into the state vector that are at'')') -write(*,'(''lon/lat/lev'',2(1x,f10.5),1x,f17.7)')loc_of_interest(1:LocationDims) +write(*,'(''lon/lat/lev'',2(1x,f10.5),1x,f20.10)')loc_of_interest(1:LocationDims) allocate( thisdist(get_model_size()) ) thisdist = 9999999999.9_r8 ! really far away @@ -275,31 +326,34 @@ subroutine find_closest_gridpoint( loc_of_interest ) closest = minval(thisdist) if (.not. matched) then - write(*,*)'No state vector elements of type '//trim(kind_of_interest) + write(*,*)'No state vector elements of '//trim(kind_of_interest) return endif -! Now that we know the distances ... report +! Now that we know the horizontal distances ... report matched = .false. do i = 1,get_model_size() if ( thisdist(i) == closest ) then call get_state_meta_data(i, loc1, var_type) + kind_name = get_raw_obs_kind_name(var_type) + rloc = get_location(loc1) + ! Only report those that are on the same vertical level. if (nint(rloc(3)) == nint(rlev)) then - kind_name = get_raw_obs_kind_name(var_type) write(*,'(''lon/lat/lev'',3(1x,f10.5),'' is index '',i10,'' for '',a)') & rloc, i, trim(kind_name) matched = .true. + else + write(*,'(''lon/lat '',2(1x,f10.5),'' is index '',i10,'' for '',a)') & + rloc(1), rloc(2), i, trim(kind_name) endif endif enddo -if ( .not. matched ) then - write(*,*)'Nothing matched the vertical.' -endif +if ( .not. matched ) write(*,*)'Nothing matched the vertical exactly.' deallocate( thisdist ) @@ -308,8 +362,3 @@ end subroutine find_closest_gridpoint end program model_mod_check -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/utilities/parse_args_mod.f90 b/utilities/parse_args_mod.f90 index c8ec0e7fc8..37928117f1 100644 --- a/utilities/parse_args_mod.f90 +++ b/utilities/parse_args_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module parse_args_mod @@ -38,10 +36,9 @@ module parse_args_mod private ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'parse_args_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' public :: get_args_from_string @@ -141,8 +138,3 @@ subroutine get_args_from_string(argline, argcount, argwords) end module parse_args_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/utilities/restart_file_tool.f90 b/utilities/restart_file_tool.f90 index 9836f2ac10..cdc28465da 100644 --- a/utilities/restart_file_tool.f90 +++ b/utilities/restart_file_tool.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ program restart_file_tool @@ -33,10 +31,9 @@ program restart_file_tool implicit none ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'restart_file_tool.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' integer :: iunit, model_size, io, member type(ensemble_type) :: ens_handle @@ -399,8 +396,3 @@ end subroutine print_temporal end program restart_file_tool -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$ diff --git a/utilities/utilities_mod.f90 b/utilities/utilities_mod.f90 index 2668924f45..7f298dc19b 100644 --- a/utilities/utilities_mod.f90 +++ b/utilities/utilities_mod.f90 @@ -1,8 +1,6 @@ ! DART software - Copyright 2004 - 2013 UCAR. This open source software is ! provided by UCAR, "as is", without charge, subject to all terms of use at ! http://www.image.ucar.edu/DAReS/DART/DART_download -! -! $Id$ module utilities_mod @@ -182,10 +180,9 @@ end subroutine exit_all end interface ! version controlled file description for error handling, do not edit -character(len=256), parameter :: source = & - "$URL$" -character(len=32 ), parameter :: revision = "$Revision$" -character(len=128), parameter :: revdate = "$Date$" +character(len=*), parameter :: source = 'utilities_mod.f90' +character(len=*), parameter :: revision = '' +character(len=*), parameter :: revdate = '' character(len=512) :: msgstring @@ -462,21 +459,12 @@ subroutine register_module(src, rev, rdate) if ( .not. do_output_flag) return if ( .not. module_details) return - write(logfileunit,*) - write(logfileunit,*)'Registering module :' - write(logfileunit,*)trim(src) - write(logfileunit,*)trim(rev) - write(logfileunit,*)trim(rdate) - write(logfileunit,*)'Registration complete.' + write(logfileunit,*)'Registering : ',trim(src) write(logfileunit,*) write( * ,*) - write( * ,*)'Registering module :' - write( * ,*)trim(src) - write( * ,*)trim(rev) - write( * ,*)trim(rdate) - write( * ,*)'Registration complete.' + write( * ,*)'Registering : ',trim(src) write( * ,*) end subroutine register_module @@ -2004,8 +1992,3 @@ end function ascii_file_format end module utilities_mod -! -! $URL$ -! $Id$ -! $Revision$ -! $Date$