Commit 8293f938 authored by Simone Butzer's avatar Simone Butzer

change name HESS_FILE, GRAD_FILE

parent 31169932
......@@ -147,12 +147,12 @@ method_(METHOD) = 0
#-----------------------------------------------------------------------------------
#
#-------------------------In- and Output Files--------------------------------------
gradient_filename_(GRAD_FILE) = ./grad/toy
gradient_filename_(GRAD_FILE) = ./grad/toy_grad
model_output_filename_(MOD_OUT_FILE) = ./model/toy
observed_data_fileneame_(SEIS_OBS_FILE) = ./su_obs/obs_toy
external_or_internal_observed_data_(EXTOBS) = 0
inversion_parameter_file_(INV_FILE) = ./in_and_out/workflow_toy.dat
hessian_file_(HESS_FILE) = ./hess/toy
hessian_file_(HESS_FILE) = ./hess/toy_hess
#
#-------------------------General---------------------------------------------------
minimum/maximum_iteration_number_(>0)_(ITMIN,ITMAX) = 1 , 80
......
......@@ -147,12 +147,12 @@ method_(METHOD) = 0
#-----------------------------------------------------------------------------------
#
#-------------------------In- and Output Files--------------------------------------
gradient_filename_(GRAD_FILE) = ./grad/toy
gradient_filename_(GRAD_FILE) = ./grad/toy_grad
model_output_filename_(MOD_OUT_FILE) = ./model/toy
observed_data_fileneame_(SEIS_OBS_FILE) = ./su_obs/obs_toy
external_or_internal_observed_data_(EXTOBS) = 0
inversion_parameter_file_(INV_FILE) = ./in_and_out/workflow_toy.dat
hessian_file_(HESS_FILE) = ./hess/toy
hessian_file_(HESS_FILE) = ./hess/toy_hess
#
#-------------------------General---------------------------------------------------
minimum/maximum_iteration_number_(>0)_(ITMIN,ITMAX) = 1 , 60
......
......@@ -392,7 +392,7 @@ void hess_F(int nx,int ny,int nz,float **** fvx,float **** fvy,float **** fvz,fl
void hess_apply(int nx1, int nx2, int ny1, int ny2, int nz1, int nz2, float ***grad1, float ***grad2,float ***grad3, float ***hess1, float ***hess2, float ***hess3, float finv, int iteration);
void readhess(int nx, int ny, int nz, float *** hess1, float *** hess2, float ***hess3);
void readhess(int nx, int ny, int nz, float *** hess1, float *** hess2, float ***hess3, float finv, int iteration);
void lbfgs(float ***grad1, float ***grad2, float ***grad3, float *bfgsscale, float **bfgsmod, float **bfgsgrad, int iteration);
void lbfgs_savegrad(float ***grad1, float ***grad2, float ***grad3,float **bfgsgrad1);
......
......@@ -644,7 +644,7 @@ CPML_coeff(K_x,alpha_prime_x,a_x,b_x,K_x_half,alpha_prime_x_half,a_x_half,b_x_ha
if(HESS&&READ_HESS==0) hloop=ntr_hess;
if(HESS&&READ_HESS==1) readhess(NX,NY,NZ,hess1,hess2,hess3);
if(HESS&&READ_HESS==1) readhess(NX,NY,NZ,hess1,hess2,hess3,finv[0], iteration+100);
MPI_Barrier(MPI_COMM_WORLD);
if(METHOD==1 && EXTOBS==1){
for (ishot=1;ishot<=nshots;ishot++){
......
......@@ -40,9 +40,9 @@ void outgrad(int nx,int ny,int nz,float ***grad1, float ***grad2,float ***grad3,
sprintf(gradfile1,"%s.gradvp_%4.2fHz_it%d.%i.%i.%i",outfile,finv,iteration,POS[1],POS[2],POS[3]);
sprintf(gradfile2,"%s.gradvs_%4.2fHz_it%d.%i.%i.%i",outfile,finv,iteration,POS[1],POS[2],POS[3]);
sprintf(gradfile3,"%s.gradrho_%4.2fHz_it%d.%i.%i.%i",outfile,finv,iteration,POS[1],POS[2],POS[3]);
sprintf(gradfile1,"%s.vp_%4.2fHz_it%d.%i.%i.%i",outfile,finv,iteration,POS[1],POS[2],POS[3]);
sprintf(gradfile2,"%s.vs_%4.2fHz_it%d.%i.%i.%i",outfile,finv,iteration,POS[1],POS[2],POS[3]);
sprintf(gradfile3,"%s.rho_%4.2fHz_it%d.%i.%i.%i",outfile,finv,iteration,POS[1],POS[2],POS[3]);
fpmod1=fopen(gradfile1,"w");
......
......@@ -23,11 +23,12 @@
#include "fd.h"
void readhess(int nx, int ny, int nz, float *** hess1, float *** hess2, float ***hess3){
void readhess(int nx, int ny, int nz, float *** hess1, float *** hess2, float ***hess3, float finv, int iteration){
extern int NX, NY, NZ, NXG, NYG, NZG, POS[4];
extern float VP0, VS0, RHO0;
extern FILE *FP;
extern char HESS_FILE[STRING_SIZE];
/* local variables */
float rhov, vp, vs; /*qp, qs;*/
......@@ -43,19 +44,21 @@ void readhess(int nx, int ny, int nz, float *** hess1, float *** hess2, float
fprintf(FP,"\n...reading hess information from hess-files...\n");
sprintf(filename,"hess/hess.vp");
/*sprintf(filename,"hess/hess.vp");*/
sprintf(filename,"%s.vp_%4.2fHz_it%d.%i.%i.%i",HESS_FILE,finv,iteration,POS[1],POS[2],POS[3]);
fp_vp=fopen(filename,"r");
if (fp_vp==NULL) err(" Could not open hess.vp ! ");
if (fp_vp==NULL) err(" Could not open hess_vp ! ");
sprintf(filename,"hess/hess.vs");
sprintf(filename,"%s.vs_%4.2fHz_it%d.%i.%i.%i",HESS_FILE,finv,iteration,POS[1],POS[2],POS[3]);
fp_vs=fopen(filename,"r");
if (fp_vs==NULL) err(" Could not open hess.vs! ");
if (fp_vs==NULL) err(" Could not open hess_vs! ");
sprintf(filename,"hess/hess.rho");
sprintf(filename,"%s.rho_%4.2fHz_it%d.%i.%i.%i",HESS_FILE,finv,iteration,POS[1],POS[2],POS[3]);
fp_rho=fopen(filename,"r");
if (fp_rho==NULL) err(" Could not open hess.rho ! ");
if (fp_rho==NULL) err(" Could not open hess_rho ! ");
/* loop over global grid */
for (j=1;j<=NYG;j++){
for (i=1;i<=NXG;i++){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment