CLAWRIM Wiki

The Computational Lab for Advanced Water Resources Informatics and Modeling

User Tools

Site Tools


howtos:how_to_compile_peakfq_on_linux

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howtos:how_to_compile_peakfq_on_linux [2024-09-19 06:48 am] hchohowtos:how_to_compile_peakfq_on_linux [2024-09-24 10:27 am] (current) hcho
Line 3: Line 3:
 First, [[How to install the Intel Fortran Compiler on Linux|install the Intel Fortran Compiler]]. First, [[How to install the Intel Fortran Compiler on Linux|install the Intel Fortran Compiler]].
  
-You can download the incomplete source code of PeakFQ from [[https://water.usgs.gov/software/PeakFQ/|its website]]. Here, I'll use [[https://water.usgs.gov/software/PeakFQ/code/7.5.1/PeakFQ_7.5.1.src.zip|PeakFQ_7.5.1.src.zip]].+You can download the incomplete source code of PeakFQ from [[https://water.usgs.gov/software/PeakFQ/|its website]]. Here, I'll use [[https://water.usgs.gov/software/PeakFQ/code/7.5.1/PeakFQ_7.5.1.src.zip|PeakFQ_7.5.1.src.zip]]. Visit [[https://github.com/HuidaeCho/peakfq-linux|its GitHub repository]].
  
 <file bash compile_peakfq.sh> <file bash compile_peakfq.sh>
Line 22: Line 22:
 for i in *.*; do for i in *.*; do
   j=$(echo $i | tr A-Z a-z)   j=$(echo $i | tr A-Z a-z)
-  [ $i = $j ] && continue +  [ $i = $j ] || mv $i $j
-  mv $i $j+
 done done
  
Line 29: Line 28:
 for i in *.*; do for i in *.*; do
   grep -q ".*.INC'" $i || continue   grep -q ".*.INC'" $i || continue
-  for j in $(grep ".*.INC'" $i | sort -u | fromdos | sed "s/^[^']*'\|'$//g"); do+  for j in $(grep ".*.INC'" $i | sort -u | sed 's/\r//; '"s/^[^']*'\|'$//g"); do
     k=$(echo $j | tr A-Z a-z)     k=$(echo $j | tr A-Z a-z)
     sed -i "s/$j/$k/" $i     sed -i "s/$j/$k/" $i
Line 38: Line 37:
 sed -Ei "s/(, )(DENYNONE)/'\1SHARE='\2/" wdoppc90.for sed -Ei "s/(, )(DENYNONE)/'\1SHARE='\2/" wdoppc90.for
  
-# comment out non-existent modules and data type +# comment out non-existent modules and data types 
-sed -Ei 's/^(.*(KERNEL32|T_OVERLAPPED).*)/!\1/' scenmod.f90+sed -Ei 's/^(.*(KERNEL32|T_OVERLAPPED))/!\1/' scenmod.f90
  
 # comment out Windows functions # comment out Windows functions
-sed -Ei 's/^(.*(peeknamedpipe|readfile|writefile))/!\1/i' scenmod.f90+sed -Ei 's/^(.*(PeekNamedPipe|ReadFile|WriteFile))/!\1/' scenmod.f90 
 + 
 +# fix disclaimer line 
 +sed -i "/^ *WRITE(DISCLM(1)/a \        DISCLM(2) = ''\r" j407xe.for 
 + 
 +# reenable default generalized skew computation 
 +sed -Ei 's/^C(.*GENSKU *=.*)/\1/; s/^Cprh( {6}AUX)/\1/; s/^( {6}AUX\(1\) = -999)/!\1/' j407xe.for
  
 # download missing files # download missing files
Line 68: Line 73:
   ; do   ; do
   wget https://svn.oss.deltares.nl/repos/openda/trunk/model_hspf/fortran/libanne4.0/src/$i   wget https://svn.oss.deltares.nl/repos/openda/trunk/model_hspf/fortran/libanne4.0/src/$i
 +done
 +
 +# dos to unix
 +for i in * */*; do
 +  sed -i 's/\r//' $i
 done done
  
Line 156: Line 166:
 # build # build
 make make
 +
 +# install PeakFQ for Windows; find and copy pkfqms.wdm in lowercase
 +# download it from this website
 +wget https://clawiki.isnew.info/_media/howtos/pkfqms.zip
 +unzip pkfqms.zip
 +rm pkfqms.zip
 </file> </file>
  
howtos/how_to_compile_peakfq_on_linux.1726750130.txt.gz · Last modified: by hcho

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki