Search the web
Sign In
New User? Sign Up
HydroLightUsers · HydroLight Users Group
? Already a member? Sign in to Yahoo!

Yahoo! Groups Tips

Did you know...
Want to share photos of your group with the world? Add a group photo to Flickr.

Best of Y! Groups

   Check them out and nominate your group.
Having problems with message search? Fill out this form to ensure your group is one of the first to be migrated to the new message search system.

Messages

  Messages Help
Advanced
Surface Irradiance Measurements   Message List  
Reply | Forward Message #30 of 91 |
Re: [HydroLightUsers] Surface Irradiance Measurements

Servet and everyone,

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


Fri Jul 6, 2007 3:25 pm

mmontes
Offline Offline
Send Email Send Email

Forward
Message #30 of 91 |
Expand Messages Author Sort by Date

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...
Servet Ahmet Cizmeli
acizmeli
Offline Send Email
Jul 6, 2007
4:46 am

Servet (and all), Even though the input file for your two runs look the same, the aren't the same run. The reason is that when you select RADTRAN, it ...
Lydia Sundman
lksundman
Offline Send Email
Jul 6, 2007
12:51 pm

Servet and everyone, In Hydrolight (HL), not everything is controlled by the input file. Some parameters are specified in the input file. Some are specified in...
Marcos Montes
mmontes
Offline Send Email
Jul 6, 2007
3:31 pm

Folks, Marcos is correct that modifying runs outside of the UI is a task that requires a lot of courage and should not be done cavalierly. I also wanted to add...
Lydia Sundman
lksundman
Offline Send Email
Jul 6, 2007
4:33 pm

I understand it much better now, especially after Marcos' comments. Thanks Marcos, thanks Lydia. One more question: Looking at my newly compiled incfiles.for,...
Servet Ahmet Cizmeli
acizmeli
Offline Send Email
Jul 6, 2007
5:43 pm

Servet, Ah, good, you found incfiles.for. When I wrote the email, I had forgotten the incfiles.for is the actual one that gets compiled. There is also a copy...
Marcos Montes
mmontes
Offline Send Email
Jul 6, 2007
6:00 pm

Servet, ... Note that the above steps do not perform a compilation. They merely consist of editing files. Really, I need to add a few steps: First, you should...
Marcos Montes
mmontes
Offline Send Email
Jul 9, 2007
4:20 pm

Hi Marcos, Thanks a lot for your precious comments. I'll try to write a fortran routine that will read the diffuse spectral irradiance along with Edtot. best ...
Servet Ahmet Cizmeli
acizmeli
Offline Send Email
Jul 9, 2007
6:49 pm

It really looks like the most important information is Eddif and eddir if you look at what the skyirrad subroutine returns. Since those are the only things...
Marcos Montes
mmontes
Offline Send Email
Jul 9, 2007
7:08 pm

Hi all: Can I ask a question about HL? I read a message talking about a Linux version of HL? Has someone suceeded in this effort? If so, how can I get a copy...
Zhiqiang Chen
zhiqiangchen18
Offline Send Email
Aug 13, 2007
4:28 pm

Hi Zhiquang You can always compile the source code under Linux. I succeeded under Linux with the (commercial) Intel fortran compiler. But this means that you...
Servet Ahmet Cizmeli
acizmeli
Offline Send Email
Aug 13, 2007
7:01 pm

Hello Zhiqiang, Are you sure you don't want to run HL through "wine" in Linux and avoid compiling? It's very easy. First install "wine". Then using the GUI, in...
Servet Ahmet Cizmeli
acizmeli
Offline Send Email
Aug 16, 2007
12:22 am

Hi Zhiqiang, Just in case you might want to run the HL DOS executable in Linux through wine, I figured out that you don't need to create a FAT32 partition. Now...
Servet Ahmet Cizmeli
acizmeli
Offline Send Email
Aug 16, 2007
12:23 am

Hi Zhiqiang and Servet, I have installed HL in a FAT32 partition and used the HL executable and the GUI through Wine. I had to install the MSVBVM60.dll and ...
Elena Torrecilla
torrecillautm
Offline Send Email
Aug 31, 2007
10:23 am

Hi Elena, As I wrote in my message, I did not pursue the challenge of running the GUI through Wine because I did not really need it. However I am pretty sure...
acizmeli
Offline Send Email
Sep 3, 2007
12:43 pm

I understand it much better now, especially after Marcos' comments. Thanks Marcos, thanks Lydia. One more question: Looking at my newly compiled incfiles.for,...
Servet Ahmet Cizmeli
acizmeli
Offline Send Email
Jul 6, 2007
6:01 pm
Advanced

Copyright © 2009 Yahoo! Inc. All rights reserved.
Privacy Policy - Terms of Service - Guidelines - Help