-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,13 +4,15 @@ | |
import subprocess | ||
|
||
input_path = "/discover/nobackup/projects/gmao/bcs_shared/preprocessing_bcs_inputs/land/routing" | ||
netcdf_path = "/usr/local/other/netcdf4/4.1.2/gcc-4.8.5" | ||
#netcdf_path = "/usr/local/other/netcdf4/4.1.2/gcc-4.8.5" | ||
install_path = "../../../../../../../../../../../install/bin" | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
zyj8881357
via email
|
||
|
||
# Remove files and directories | ||
os.system("rm -rf inputs >& /dev/null") | ||
os.system("rm -rf outputs >& /dev/null") | ||
os.system("rm -f *.mod >& /dev/null") | ||
os.system("rm -f *.out >& /dev/null") | ||
#os.system("rm -f *.mod >& /dev/null") | ||
#os.system("rm -f *.out >& /dev/null") | ||
os.system("rm -f *.x >& /dev/null") | ||
This comment has been minimized.
Sorry, something went wrong.
gmao-rreichle
Contributor
|
||
os.system("rm -f Outlet_latlon.43200x21600 >& /dev/null") | ||
|
||
# Create directories and symbolic links | ||
|
@@ -19,7 +21,7 @@ | |
for file in os.listdir(input_path): | ||
os.symlink(os.path.join(input_path, file), os.path.join("inputs", file)) | ||
|
||
# Build and run Fortran programs | ||
# Link and run Fortran programs | ||
programs = [ | ||
"get_outlets_catchindex", | ||
"get_outlets_land", | ||
|
@@ -29,18 +31,21 @@ | |
"Pfaf_to_2d_30s_land", | ||
] | ||
|
||
for program in programs: | ||
print(f"Building {program} ...") | ||
#for program in programs: | ||
# print(f"Building {program} ...") | ||
#subprocess.run(["./build", program]) | ||
subprocess.run(f"gfortran constant.f90 {program}.f90 -I{netcdf_path}/include -L{netcdf_path}/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz -lsz -ldl -o {program}.out",shell=True) | ||
# subprocess.run(f"gfortran constant.f90 {program}.f90 -I{netcdf_path}/include -L{netcdf_path}/lib -lnetcdff -lnetcdf -lhdf5_hl -lhdf5 -lcurl -lz -lsz -ldl -o {program}.out",shell=True) | ||
current_working_directory = os.getcwd() | ||
for program in programs: | ||
os.symlink(os.path.join(install_path, program+".x"), os.path.join(current_working_directory, program+".x")) | ||
|
||
out_programs = [ | ||
"get_outlets_catchindex.out", | ||
"get_outlets_land.out", | ||
"get_sinkxy_land.out", | ||
"get_outlets_land_allcat.out", | ||
"get_landocean_Greenland_real.out", | ||
"Pfaf_to_2d_30s_land.out", | ||
"get_outlets_catchindex.x", | ||
"get_outlets_land.x", | ||
"get_sinkxy_land.x", | ||
"get_outlets_land_allcat.x", | ||
"get_landocean_Greenland_real.x", | ||
"Pfaf_to_2d_30s_land.x", | ||
] | ||
|
||
for out_program in out_programs: | ||
|
@@ -54,6 +59,7 @@ | |
os.system("rm -rf outputs") | ||
os.system("rm -rf inputs") | ||
print("Removing *.out files ...") | ||
os.system("rm -f *.out") | ||
os.system("rm -f *.mod") | ||
#os.system("rm -f *.out") | ||
os.system("rm -f *.x") | ||
This comment has been minimized.
Sorry, something went wrong.
gmao-rreichle
Contributor
|
||
#os.system("rm -f *.mod") | ||
|
@zyj8881357 : Have you tried run.py after the most recent commit? If I'm not mistaken, the new CMakeLists.txt does (intentionally) not install the programs, so after a build the *.x file are probably still in the preproc dir