Skip to content

Commit

Permalink
Allow longer variable list for files
Browse files Browse the repository at this point in the history
Also, make this a parameter rather than a duplicated magic number
  • Loading branch information
billsacks committed Feb 26, 2018
1 parent a8dab7f commit 30b4986
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 86 deletions.
17 changes: 3 additions & 14 deletions libglad/glad_io.F90.default
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! WARNING: this file was automatically generated on
! Thu, 16 Nov 2017 22:28:05 +0000
! Mon, 26 Feb 2018 02:27:00 +0000
! from ncdf_template.F90.in
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Expand Down Expand Up @@ -45,14 +45,14 @@ module glad_io
! written by Magnus Hagdorn, 2004

use glad_type
use glimmer_ncdf

implicit none

private :: get_xtype, is_enabled, is_enabled_0dint, is_enabled_1dint, &
is_enabled_2dint, is_enabled_0dreal, is_enabled_1dreal, is_enabled_2dreal, is_enabled_3dreal

character(310), save :: restart_variable_list='' ! list of variables needed for a restart
!TODO change 310 to a variable - see glimmer_ncdf.F90 in the definition for type glimmer_nc_stat for other instances of this value.
character(glimmer_nc_vars_len), save :: restart_variable_list='' ! list of variables needed for a restart

interface is_enabled ! MJH 10/21/13: Interface needed for determining if arrays have been enabled. See notes below in glad_io_create.
module procedure is_enabled_0dint
Expand All @@ -73,7 +73,6 @@ contains
! open all netCDF files for output
use glad_type
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glide_global_type) :: model
Expand All @@ -99,7 +98,6 @@ contains
! if necessary write to netCDF files
use glad_type
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glad_instance) :: data
Expand Down Expand Up @@ -146,7 +144,6 @@ contains
use parallel
use glide_types
use glad_type
use glimmer_ncdf
use glimmer_ncio
use glimmer_map_types
use glimmer_log
Expand Down Expand Up @@ -378,7 +375,6 @@ contains
subroutine glad_io_write(outfile,data)
use parallel
use glad_type
use glimmer_ncdf
use glimmer_paramets
use glimmer_scales
implicit none
Expand Down Expand Up @@ -547,7 +543,6 @@ contains
! read from netCDF file
use glad_type
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glad_instance) :: data
Expand Down Expand Up @@ -583,7 +578,6 @@ contains
! Read data from forcing files
use glimmer_log
use glide_types
use glimmer_ncdf

implicit none
type(glad_instance) :: data
Expand Down Expand Up @@ -635,7 +629,6 @@ contains
! read variables from a netCDF file
use parallel
use glimmer_log
use glimmer_ncdf
use glad_type
use glimmer_paramets
use glimmer_scales
Expand Down Expand Up @@ -772,7 +765,6 @@ contains
! check if dimension sizes in file match dims of model
use parallel
use glimmer_log
use glimmer_ncdf
use glide_types
use glad_type
implicit none
Expand All @@ -795,7 +787,6 @@ contains
use parallel
use glide_types
use glad_type
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile
! structure containg output netCDF descriptor
Expand All @@ -815,7 +806,6 @@ contains
subroutine glad_avg_reset(outfile,data)
use parallel
use glad_type
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile
! structure containg output netCDF descriptor
Expand All @@ -836,7 +826,6 @@ contains

!> apply default type to be used in netCDF file
integer function get_xtype(outfile,xtype)
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile !< derived type holding information about output file
integer, intent(in) :: xtype !< the external netCDF type
Expand Down
17 changes: 3 additions & 14 deletions libglad/glad_mbal_io.F90.default
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! WARNING: this file was automatically generated on
! Thu, 16 Nov 2017 22:28:05 +0000
! Mon, 26 Feb 2018 02:27:00 +0000
! from ncdf_template.F90.in
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Expand Down Expand Up @@ -45,14 +45,14 @@ module glad_mbal_io
! written by Magnus Hagdorn, 2004

use glad_type
use glimmer_ncdf

implicit none

private :: get_xtype, is_enabled, is_enabled_0dint, is_enabled_1dint, &
is_enabled_2dint, is_enabled_0dreal, is_enabled_1dreal, is_enabled_2dreal, is_enabled_3dreal

character(310), save :: restart_variable_list='' ! list of variables needed for a restart
!TODO change 310 to a variable - see glimmer_ncdf.F90 in the definition for type glimmer_nc_stat for other instances of this value.
character(glimmer_nc_vars_len), save :: restart_variable_list='' ! list of variables needed for a restart

interface is_enabled ! MJH 10/21/13: Interface needed for determining if arrays have been enabled. See notes below in glad_mbal_io_create.
module procedure is_enabled_0dint
Expand All @@ -73,7 +73,6 @@ contains
! open all netCDF files for output
use glad_type
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glide_global_type) :: model
Expand All @@ -99,7 +98,6 @@ contains
! if necessary write to netCDF files
use glad_type
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glad_instance) :: data
Expand Down Expand Up @@ -146,7 +144,6 @@ contains
use parallel
use glide_types
use glad_type
use glimmer_ncdf
use glimmer_ncio
use glimmer_map_types
use glimmer_log
Expand Down Expand Up @@ -464,7 +461,6 @@ contains
subroutine glad_mbal_io_write(outfile,data)
use parallel
use glad_type
use glimmer_ncdf
use glimmer_paramets
use glimmer_scales
implicit none
Expand Down Expand Up @@ -612,7 +608,6 @@ contains
! read from netCDF file
use glad_type
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glad_instance) :: data
Expand Down Expand Up @@ -648,7 +643,6 @@ contains
! Read data from forcing files
use glimmer_log
use glide_types
use glimmer_ncdf

implicit none
type(glad_instance) :: data
Expand Down Expand Up @@ -700,7 +694,6 @@ contains
! read variables from a netCDF file
use parallel
use glimmer_log
use glimmer_ncdf
use glad_type
use glimmer_paramets
use glimmer_scales
Expand All @@ -722,7 +715,6 @@ contains
! check if dimension sizes in file match dims of model
use parallel
use glimmer_log
use glimmer_ncdf
use glide_types
use glad_type
implicit none
Expand Down Expand Up @@ -817,7 +809,6 @@ contains
use parallel
use glide_types
use glad_type
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile
! structure containg output netCDF descriptor
Expand All @@ -837,7 +828,6 @@ contains
subroutine glad_mbal_avg_reset(outfile,data)
use parallel
use glad_type
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile
! structure containg output netCDF descriptor
Expand All @@ -858,7 +848,6 @@ contains

!> apply default type to be used in netCDF file
integer function get_xtype(outfile,xtype)
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile !< derived type holding information about output file
integer, intent(in) :: xtype !< the external netCDF type
Expand Down
17 changes: 3 additions & 14 deletions libglide/glide_io.F90.default
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! WARNING: this file was automatically generated on
! Thu, 16 Nov 2017 22:28:05 +0000
! Mon, 26 Feb 2018 02:27:00 +0000
! from ncdf_template.F90.in
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Expand Down Expand Up @@ -46,14 +46,14 @@ module glide_io
! written by Magnus Hagdorn, 2004

use glide_types
use glimmer_ncdf

implicit none

private :: get_xtype, is_enabled, is_enabled_0dint, is_enabled_1dint, &
is_enabled_2dint, is_enabled_0dreal, is_enabled_1dreal, is_enabled_2dreal, is_enabled_3dreal

character(310), save :: restart_variable_list='' ! list of variables needed for a restart
!TODO change 310 to a variable - see glimmer_ncdf.F90 in the definition for type glimmer_nc_stat for other instances of this value.
character(glimmer_nc_vars_len), save :: restart_variable_list='' ! list of variables needed for a restart

interface is_enabled ! MJH 10/21/13: Interface needed for determining if arrays have been enabled. See notes below in glide_io_create.
module procedure is_enabled_0dint
Expand All @@ -74,7 +74,6 @@ contains
! open all netCDF files for output
use glide_types
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glide_global_type) :: model
Expand All @@ -100,7 +99,6 @@ contains
! if necessary write to netCDF files
use glide_types
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glide_global_type) :: data
Expand Down Expand Up @@ -147,7 +145,6 @@ contains
use parallel
use glide_types
use glide_types
use glimmer_ncdf
use glimmer_ncio
use glimmer_map_types
use glimmer_log
Expand Down Expand Up @@ -4811,7 +4808,6 @@ contains
subroutine glide_io_write(outfile,data)
use parallel
use glide_types
use glimmer_ncdf
use glimmer_paramets
use glimmer_scales
implicit none
Expand Down Expand Up @@ -6147,7 +6143,6 @@ contains
! read from netCDF file
use glide_types
use glide_types
use glimmer_ncdf
use glimmer_ncio
implicit none
type(glide_global_type) :: data
Expand Down Expand Up @@ -6183,7 +6178,6 @@ contains
! Read data from forcing files
use glimmer_log
use glide_types
use glimmer_ncdf

implicit none
type(glide_global_type) :: data
Expand Down Expand Up @@ -6235,7 +6229,6 @@ contains
! read variables from a netCDF file
use parallel
use glimmer_log
use glimmer_ncdf
use glide_types
use glimmer_paramets
use glimmer_scales
Expand Down Expand Up @@ -7778,7 +7771,6 @@ contains
! check if dimension sizes in file match dims of model
use parallel
use glimmer_log
use glimmer_ncdf
use glide_types
use glide_types
implicit none
Expand Down Expand Up @@ -7873,7 +7865,6 @@ contains
use parallel
use glide_types
use glide_types
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile
! structure containg output netCDF descriptor
Expand Down Expand Up @@ -7923,7 +7914,6 @@ contains
subroutine glide_avg_reset(outfile,data)
use parallel
use glide_types
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile
! structure containg output netCDF descriptor
Expand Down Expand Up @@ -7974,7 +7964,6 @@ contains

!> apply default type to be used in netCDF file
integer function get_xtype(outfile,xtype)
use glimmer_ncdf
implicit none
type(glimmer_nc_output), pointer :: outfile !< derived type holding information about output file
integer, intent(in) :: xtype !< the external netCDF type
Expand Down
9 changes: 6 additions & 3 deletions libglimmer/glimmer_ncdf.F90
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ module glimmer_ncdf

implicit none

integer, parameter :: glimmer_nc_vars_len = 1024
!> maximum length for lists of variables in file

integer, parameter :: glimmer_nc_meta_len = 100
!> maximum length for meta data

Expand Down Expand Up @@ -114,9 +117,9 @@ module glimmer_ncdf
! TODO - Create a variable for vars length so it can be made longer (Matt has this implemented in his subglacial hydrology branch)
! Apply it here for vars, vars_copy and to restart_variable_list in glimmer_ncparams.F90

character(len=310) vars !> string containing variables to be processed
logical :: restartfile = .false. !> Set to true if we're writing a restart file
character(len=310) vars_copy !> string containing variables to be processed (retained copy)
character(len=glimmer_nc_vars_len) :: vars !> string containing variables to be processed
logical :: restartfile = .false. !> Set to true if we're writing a restart file
character(len=glimmer_nc_vars_len) :: vars_copy !> string containing variables to be processed (retained copy)

end type glimmer_nc_stat

Expand Down
Loading

0 comments on commit 30b4986

Please sign in to comment.