[Dart-dev] DART/branches Revision: 11899
dart at ucar.edu
dart at ucar.edu
Mon Aug 14 10:40:37 MDT 2017
hendric at ucar.edu
2017-08-14 10:40:36 -0600 (Mon, 14 Aug 2017)
60
removing unneeded conde and making variable names clearer.
Modified: DART/branches/rma_fix_clm_restarts/models/clm/model_mod.f90
===================================================================
--- DART/branches/rma_fix_clm_restarts/models/clm/model_mod.f90 2017-08-11 16:22:52 UTC (rev 11898)
+++ DART/branches/rma_fix_clm_restarts/models/clm/model_mod.f90 2017-08-14 16:40:36 UTC (rev 11899)
@@ -1518,7 +1518,7 @@
real(r8), allocatable, dimension(:,:) :: data_2d_array
real(r8), allocatable, dimension(:,:,:) :: data_3d_array
-integer :: io, ncid_in, ncid_out, var_id_out, TimeDimID, VarID, ncNdims, dimlen, numvars
+integer :: io, ncid_in, ncid_dart, var_id_out, TimeDimID, VarID, ncNdims, dimlen, numvars
integer, dimension(NF90_MAX_VAR_DIMS) :: dimIDs
character (len=NF90_MAX_NAME) :: varname
character (len=256) :: myerrorstring
@@ -1560,7 +1560,7 @@
! open an existing netcdf file that has is a copy of clm_restart_filename
! to fill in missing_r8 values.
-call nc_check(nf90_open(trim(clm_file), NF90_WRITE, ncid_out), &
+call nc_check(nf90_open(trim(clm_file), NF90_WRITE, ncid_dart), &
'clm_to_dart_state_vector', 'open clm_file file "'//trim(clm_file)//'"')
! Start counting and filling the state vector one item at a time,
@@ -1587,9 +1587,9 @@
call nc_check(nf90_inquire_variable( ncid_in, VarID, dimids=dimIDs, ndims=ncNdims), &
'clm_to_dart_state_vector', 'inquire_variable '//trim(myerrorstring))
- call nc_check(nf90_inq_varid(ncid_out, varname, var_id_out), &
+ call nc_check(nf90_inq_varid(ncid_dart, varname, var_id_out), &
'clm_to_dart_state_vector', 'inq_varid output '//trim(myerrorstring))
- call nc_check(nf90_inquire_variable( ncid_out, var_id_out), &
+ call nc_check(nf90_inquire_variable( ncid_dart, var_id_out), &
'clm_to_dart_state_vector', 'inquire_variable '//trim(myerrorstring))
! Check the rank of the variable
@@ -1638,7 +1638,7 @@
allocate(data_1d_array(ni))
call DART_get_var(ncid_in, varname, data_1d_array)
- call nc_check(nf90_put_var(ncid_out, var_id_out, data_1d_array), &
+ call nc_check(nf90_put_var(ncid_dart, var_id_out, data_1d_array), &
'nc_write_model_atts', 'put_var '//trim(varname))
deallocate(data_1d_array)
@@ -1707,7 +1707,7 @@
enddo
endif
- call nc_check(nf90_put_var(ncid_out, var_id_out, data_2d_array), &
+ call nc_check(nf90_put_var(ncid_dart, var_id_out, data_2d_array), &
'get_var_2d', 'put_var '//trim(varname))
deallocate(data_2d_array)
@@ -1735,7 +1735,7 @@
! applied correctly for PBOT, TBOT ... so there is no need for the
! extra processing that is present in the previous loops.
- call nc_check(nf90_put_var(ncid_out, var_id_out, data_3d_array), &
+ call nc_check(nf90_put_var(ncid_dart, var_id_out, data_3d_array), &
'nc_write_model_atts', 'put_var '//trim(varname))
deallocate(data_3d_array)
@@ -1773,20 +1773,20 @@
deallocate(snlsno)
-call nc_check(nf90_close(ncid_out),'clm_to_dart_state_vector','close out'//progvar(ivar)%origin)
+call nc_check(nf90_close(ncid_dart),'clm_to_dart_state_vector','close out'//progvar(ivar)%origin)
end subroutine clm_to_dart_state_vector
-subroutine sv_to_restart_file(file_orig, file_out, dart_time)
+subroutine sv_to_restart_file(file_dart, file_clm, dart_time)
!------------------------------------------------------------------
! Writes the current time and state variables from a dart state
! vector (1d array) into a clm netcdf restart file.
!
-character(len=*), intent(in) :: file_orig
-character(len=*), intent(in) :: file_out
+character(len=*), intent(in) :: file_dart
+character(len=*), intent(in) :: file_clm
type(time_type), intent(in) :: dart_time
! temp space to hold data while we are writing it
@@ -1797,7 +1797,7 @@
integer, dimension(NF90_MAX_VAR_DIMS) :: dimIDs
character(len=NF90_MAX_NAME) :: varname
integer :: varid_out, VarID, ncNdims, dimlen, numvars
-integer :: ncid_out, ncid_orig, create_mode
+integer :: ncid_dart, ncid_clm, create_mode
type(time_type) :: file_time
if ( .not. module_initialized ) call static_init_model
@@ -1804,34 +1804,29 @@
! Check that the output file exists ...
-if ( .not. file_exist(file_orig) ) then
- write(string1,*) 'cannot open original file "', trim(file_orig),'" for writing.'
More information about the Dart-dev
mailing list