I'm having a failure on reading in a namelist in gfortran. The version information is below:
bash-3.2$ gfortran -v Using built-in specs. Target: powerpc-apple-darwin9.3.0 Configured with: /var/tmp/gfortran-20080530/ibin/../gcc/configure --prefix=/usr/local/gfortran --enable-languages=c,fortran --with-gmp=/var/tmp/gfortran-20080530/gfortran_libs --enable-bootstrap --with-included-gettext Thread model: posix gcc version 4.4.0 20080530 (experimental) [trunk revision 136204] (GCC) What's happening is I have a namelist which begins with: &INPUT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! DOMAIN AND INITIAL PARAMS !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! nxc = 100, !Number of cells And when it reads in, I get the following error: bash-3.2$ ./Transport1D At line 42 of file /Users/rossnorm/NCAR08/1D/src/mem_nml.f90 (unit = 101, file = 'Transport1D.namelist') Fortran runtime error: Cannot match namelist object name !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!nxc However, if I change the beginning of the namelist to the following: &INPUT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! DOMAIN AND INITIAL PARAMS !!!!!!!!!!!!!!!!!!!!!!!!!! nxc = 100, !Number of cells the whole namelist is read in fine, and the correct values can be printed back out to stdout internally. So, that last line of "!!!!!" is for some reason causing a failure in the gfortran namelist reading routines when I do not believe there should be any hinderance according to the standards. Just in case you want my code to read in the namelist and the entire namelist itself (the namelist which failed), it is below. In the module mem_nml.f90, the subroutine readNamelist() is what reads in the values. mem_nml.f90 !Module to read input parameters for a 1D transport !simulation. The file must be 'Transport1D.namelist' module mem_nml implicit none integer, save :: nxc double precision, save :: dleft double precision, save :: dright integer, save :: init_type double precision, save :: dt double precision, save :: max_courant double precision, save :: sim_time integer, save :: time_method integer, save :: sd_timesolver integer, save :: subgrid_approx integer, save :: linear_lim integer, save :: ppm_filter logical, save :: pd_filter character*100,save :: outfile_prefix contains subroutine readNamelist() implicit none namelist /INPUT/ nxc, & dleft, & dright, & init_type, & dt, & max_courant, & sim_time, & time_method, & sd_timesolver, & subgrid_approx, & linear_lim, & ppm_filter, & pd_filter, & outfile_prefix open(unit = 101, file = 'Transport1D.namelist', action = 'read') read(unit = 101, nml = INPUT) close(unit = 101) endsubroutine endmodule mem_nml Transport1D.namelist &INPUT !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!! DOMAIN AND INITIAL PARAMS !!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! nxc = 100, !Number of cells dleft = 0., !Domain left location (meters) dright = 1., !Domain right location (meters) !dright must be < dleft !Note that the grid spacing is calculated dynamically as: !(domain length) / nxc = (dright - dleft) / nxc init_type = 1, !Type of initialization to use ! 1: sine wave ! 2: rectangle wave ! 3: triangle wave ! 4: irregular signal ! 5: "double hump" !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!! TIME INTEGRATION PARAMS !!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! dt = 0.000, !Time step (seconds) !A value <= 0 will invoke automated calculation !of time step based on max domain wave speed. max_courant = 2.0, !This specifies the maximum Courant number desired !during the simulation. !(Only activated if dt == 0) sim_time = 0.225, !time length of simulation (seconds) !Note two things: !(1) The number of time steps = ceiling( (sim_time) / (avg time step) ) ! since the timestep may change if dt = 0 !(2) The simulation does not necessarily end precisely at sim_time unless ! sim_time is chosen to be a multiple of dt (i.e. non-zero dt specification) time_method = 1, !How to treat the time derivative of the PDE: ! 1: Decouple spatial and temporal accuracy via ! the semi-discrete system. This enables the ! specification of sd_timesolver ! 2: Coupled spatial/temporal accuracy via ! integrating along characteristics. ! In this case, temporal accuracy is generally ! the same as spatial, depending upon the ! choice of sub-grid functional approximation. sd_timesolver = 1, !Type of time integration to use for semi-discrete !solver type (only activated if time_method == 1): ! 1: RK-1 (1) ! 2: RK-2 (1/2 , 1) ! 3: RK-3 (1/3 , 1/2 , 1) ! 4: RK-4 (1/4 , 1/3 , 1/2 , 1) !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!! SPATIAL APPROXIMATION PARAMS !!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! subgrid_approx = 0, !What type of subgrid recontruction to use? ! 0: Constant ! 1: Linear ! 2: WENO (2nd-order) ! 3: Piecewise Hyperbolic Method (PHM) ! 4: Piecewise Double Hyperbolic Method (PDHM) ! 5: Piecewise Logarithmic Method (PLM) ! Cannot use PLM with time_method == 2 ! 6: Piecewise Double Logarithmic Method (PDLM) ! Should not use PDLM with time_method == 2 ! 7: Piecewise Parabolic Method (PPM) ! 8: Piecewise Double Logarithmic Method (PRM) ! 9: WENO (3rd-order) ! 10: WENO (4th-order) ! 11: WENO (5th-order) linear_lim = 0, !Type of limiter to use for linear reconstruction !Taken directly from Wikipedia's wiki. ! 0: No limiter ! 1: CHARM (Zhou, 1995) [not TVD] ! 2: HCUS (Waterson & Deconinck, 1995) [not TVD] ! 3: HQUICK (Waterson & Deconinck, 1995)[not TVD] ! 4: Koren (Koren, 1993) ! 5: minmod (Roe, 1986) ! 6: monotonized central (van Leer, 1977) ! 7: Osher (Chatkravathy and Osher, 1983) ! 8: ospre (Waterson & Deconinck, 1995) ! 9: smart (Gaskell & Lau, 1988) [not TVD] ! 10: superbee (Roe, 1986) ! 11: Sweby (Sweby, 1984) ! 12: UMIST (Lien & Leschziner, 1994) ! 13: van Albada 1 (van Albada et al, 1982) ! 14: van Albada 2 (Kermani, 2003) [not TVD] ! 15: van Leer (van Leer, 1974) ppm_filter = 1, !What type of monotonic filter to use for PPM ! 0: No filter ! 1: Standard Collela & Woodward (1984) filter pd_filter = .true., !Use a positivity filter (multiplicative filler)? !This is a conservative filter redistributing the !mass gained in the hole filling by taking away !from other fields proportionalto the amount !currently in the field (with a minimum cutoff). !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! OUTPUT PARAMS !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !Prefix of the output files. Two files will be written per !simulation: prefix_init.dat and prefix_final.dat outfile_prefix = 'test' &END -- Summary: Namelist Comments Problems Product: gcc Version: 4.4.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: fortran AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mrnorman at ncsu dot edu GCC build triplet: powerpc-apple-darwin9 GCC host triplet: powerpc-apple-darwin9 GCC target triplet: powerpc-apple-darwin9 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=36676