3 bug fixes and 2 documentation typos #40
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@SnowHydrology: 3 bug fixes and 2 documentation typos. The three bug fixes were documented in Issues 37, 38 and 39.
Bug fix 1
When compiling Snow-17 with an M3 Max CPU I get the following error:
% make -f Makefile.local gfortran -O3 -fdefault-real-8 -fno-align-commons -ffree-line-length-none -cpp -fcheck=all -march=native -c ..//src/snow19//zero19.f ..//src/snow19//rout19.f ..//src/snow19//aesc19.f ..//src/snow19//melt19.f ..//src/snow19//SNEW.f ..//src/snow19//SNOWT.f ..//src/snow19//SNOWPACK.f ..//src/snow19//adjc19.f ..//src/snow19//aeco19.f ..//src/snow19//updt19.f ..//src/snow19//SNDEPTH.f ..//src/snow19//PACK19.f ..//src/snow19//exsnow19.f -I/opt/homebrew/include gfortran -O3 -fdefault-real-8 -fno-align-commons -ffree-line-length-none -cpp -fcheck=all -c ..//src/share//nrtype.f90 ..//src/share//constants.f90 ..//src/share//namelistModule.f90 ..//src/share//parametersType.f90 ..//src/share//forcingType.f90 ..//src/share//dateTimeUtilsModule.f90 ..//src/share//runInfoType.f90 ..//src/share//modelVarType.f90 ..//src/share//ioModule.f90 ..//src/share//runSnow17.f90 ..//src/bmi//bmi.f90 ..//src/bmi//bmi_snow17.f90 ..//src/driver//driver_bmi.f90 -I/opt/homebrew/include gfortran -fPIC -I/opt/homebrew/include -L/opt/homebrew/lib -o ..//bin//snow17.exe *.o Undefined symbols for architecture arm64: "_is_recursive.12.0", referenced from: ___forcingtype_MOD_initforcing in forcingType.o ___forcingtype_MOD_initforcing in forcingType.o ___forcingtype_MOD_initforcing in forcingType.o "_is_recursive.14.0", referenced from: ___modelvartype_MOD_initmodelvar in modelVarType.o ___modelvartype_MOD_initmodelvar in modelVarType.o ___modelvartype_MOD_initmodelvar in modelVarType.o ld: symbol(s) not found for architecture arm64 collect2: error: ld returned 1 exit status make: *** [link] Error 1
Resolution:
In share/forcingType.f90 change:
class(forcing_type), intent(out) :: this
to:
class(forcing_type), intent(inout) :: this
In share/modelVarType.f90 change:
class(modelvar_type), intent(out) :: this
to
class(modelvar_type), intent(inout) :: this
These changes make these two class declarations consistent with similar files.
Bug fix 2
Building Snow-17 (standalone) on a PC in Visual Studio using the Intel Fortran compiler produces an error in updt19.f at line 50:
Error #6633: The type of the actual argument differs from the type of dummy argument. [LIQW]
Resolution:
The error is caused because LIQW is implicitly INTEGER type. This error was fixed by add at line 25 of updt19.f:
REAL LIQW
Bug fix 3
When building Snow-17 (standalone) on a PC in Visual Studio using the Intel Fortran compiler, the program fails to read forcing data files and crashes. In file ioModule.f90, subroutine init_forcing_files(), the integer ios is not initialized and acquires an unrestricted value with this compiler.
Resolution:
Add at line 175:
ios = 0
Typos
/build
to./build
in the following command:Testing
The 3 bug fixes were tested on MacOS and Windows computers by comparing the output of data in the ex1 directory. The output of the two runs was the same within roundoff error.
Target Environment support