In Hydrolight (HL), not everything is controlled by the input file. Some parameters are specified in the input file. Some are specified in the source code. Anytime that any piece of the source code changes, HL needs to be recompiled. The user interface (UI) edits and write the input file and it also edits some of the source code.
So, when certain parameters are changed for calculations, what ends up happening is that both the source code and the input file are modified. This is why HL needs to be recompiled. And this is why you should always run HL from the UI unless you understand all the ins and outs about the how the source code gets modified (and you should also know Fortran, and be comfortable compiling HL by hand).
The piece of source code that usually gets modified is in the maincode\batch\ folder (directory); maincode is somewhere in the the main Hydrolight Directory. [Note that the file dimens.inc can also be modified through the user interface, but it is of no concern for this question.] In your case the file name is probably maincode\batch\irrad.for (sort by date and see the newest file). If you go completely through the UI, you'll see that this file changes depending on the specifications of the run. This file has several subroutines. The one we are concerned with currently is the one called subroutine skyirrad. When you choose to input the irradiance, then yours probably looks something like:
c -----------------------------------------
subroutine skyirrad(suntheta,sunphi,eddif,eddir)
c
c This file selects the sky irradiance model to be used in the run,
c and is called by routine qasky.
c
real suntheta,sunphi,eddif,eddir
c
INCLUDE 'dimens.inc'
c
Character surfname*120,pfname*120,
1 Drootname*120,Srootname*120,Mrootname*120,
2 datafiles*120
COMMON /Cfilenames/ surfname,pfname(mxcomp),
1 Drootname,Srootname,Mrootname,
2 datafiles(0:7+mxcomp)
real dirfrac, Edtot
c call irradat to read the specified datafile
call irradat( Edtot, datafiles(11) )
c
c Routine GCIRRAD provides the RADTRAN direct:diffuse ratio
write(10,531)
call gcirrad(suntheta,sunphi,eddif,eddir)
dirfrac = eddir/(eddir+eddif)
c
c Use dirfrac from RADTRAN and the total Ed from the data file
c to calculate the direct and diffuse parts
eddir = dirfrac * Edtot
eddif = Edtot - eddir
c
write(10,533) dirfrac
write(10,532) Eddif,Eddir,Edtot
531 format(//2x,'Gregg and Carder values used to get the ratio of ',
1'diffuse to direct irradiance'/)
532 format(//2x,'Sky spectral irradiances used by Hydrolight for ',
1'this run (from datafile and G&C ratio):'/10x,'Ed(diffuse) =',
2 1pe11.3,5x,'Ed(direct) =',e11.3,5x,'Ed(total) =',e11.3)
533 format(5x,'Ratio of direct to total Irradiance ',
1'as calculated from the Gregg and Carder model:',f6.3)
return
end
c -----------------------------------------
The line I highlighted in red is the one that calls subroutine irradat (in the maincode directory) that reads the specified file (whose name is stored in the variable datafiles(11), but it is not always 11 - it depends on the number of components in your model).
Note that folks who use the UI and seleclt Radtran to set the irradiance would typically have a skyirrad subroutine that looks something like:
c -----------------------------------------
subroutine skyirrad(suntheta,sunphi,eddif,eddir)
c
c This file selects the sky irradiance model to be used in the run,
c and is called by routine qasky.
c
real suntheta,sunphi,eddif,eddir
c
INCLUDE 'dimens.inc'
c
call gcirrad(suntheta,sunphi,eddif,eddir)
return
end
c -----------------------------------------
There is no call to the subroutine irradat and the input file is not read in this case, as expected.
Oh, it is also informative to look at the rest of the file in the batch directory. If you are using fixed component concentrations, you'll see that they are listed in the same file (again, in your case, maincode\batch\irrad.for) and are in fact hard wired into the source code in the subroutine abmodel.
So, in order to do what you want using the current generation of the code:
1) If you are changing only the input irradiance file name, change that name in the input file (the last line). Make sure you've compiled a version that includes a subroutine skyirrad that has a call irradat line. Then you can make several input files each with a different irradiance file name, and run to your heart's content without recompiling.
2) If you are changing multiple parameters in set of HydroLight runs, then you need to be more careful because, as mentioned at the top of this message, some items are compiled into the code (and so not affected by the input file) and some are not. Any time one of the items that is compiled into the code is changed, then HydroLight needs to be recompiled.
-Marcos
Servet Ahmet Cizmeli wrote:
Hi everybody, I would like to use the spectral downwelling irradiance measurements we performed above water surface instead of the Radtran sky model. With the GUI (H42), I created two runs: 1. a run that uses the option RADTRAN 2. a second run that is exactly similar to the first one except that it uses the option "USER-SUPPLIED DATA FILE" (E:\H42\data\irradata.txt) When I compare the two Input files associated with these two runs, I see that they are exactly the same (except the first-two lines). To my understanding, the two runs should create output files that would exactly be the same... However in the output files, Ed above surface are slightly different... Am I missing something here? What is the parameter in the Input file that makes Hydrolight use the sky model we want and to what RECORD GROUP it does belong? I need to perfectly understand how it works as I am building an automated system that will bypass the GUI and modify the Input file for each run. thanks from advance for your input best servet My Input file: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% irrad irrad 0 1 2 1 0 2 4 1 440 0.1 0.014 3 440 0.1 0.014 -2 440 1 0.014 3 440 0 1 ..\data\pfh2oab.txt ..\data\defaults\apstarchl.txt dummyastar.txt ..\data\defaults\apstarchl.txt 0 -999 -999 -999 -999 -999 1 -999 -999 -999 -999 -999 bstarDummy.txt dummybstar.txt 0 0 0 0.0005 0 0 0 0.0005 pureh2o.dpf avgpart.dpf 27 405, 415, 427, 440, 450, 460, 470, 485, 495, 505, 515, 525, 535, 545, 560, 570, 580, 590, 600, 615, 625, 635, 645, 660, 670, 680, 685, 700, 0, 1, 0, 0, 4 2, 3, 30, 0, 0 0.00 0, 0 0, 11, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, ..\data\pfh2oab.txt 1 E:\H42\data\a_phystar_2001_085.txt dummyFilteredAc9.txt dummyHscat.txt E:\H42\data\CHL_2001_085.txt dummyCDOMdata.txt dummyR.bot dummydata.txt dummyComp.txt E:\H42\data\irradata.txt Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/HydroLightUsers/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/HydroLightUsers/join (Yahoo! ID required) <*> To change settings via email: mailto:HydroLightUsers-digest@yahoogroups.com mailto:HydroLightUsers-fullfeatured@yahoogroups.com <*> To unsubscribe from this group, send an email to: HydroLightUsers-unsubscribe@yahoogroups.com <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/
-- Marcos Montes, Ph.D. Research Physicist Code 7232, Naval Research Laboratory, Washington, DC 20375 marcos.montes@... \W: 202-767-7308 \ Fax: 202-404-5689