Changeset 23988
- Timestamp:
- 06/05/19 10:08:12 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
TabularUnified issm/trunk-jpl/test/NightlyRun/test4003.m ¶
r23908 r23988 3 3 % 4 4 %Script control parameters 5 steps=[1 2 3 4 5 6 7 8 9 10 11 12];5 steps=[1 2 3 4 5 6 7 8 9 10 11]; 6 6 final_time=1/365; 7 7 … … 326 326 % {{{ RunCoupledMITgcmISSM: 327 327 if perform(org,'RunCoupledMITgcmISSM'), 328 329 %load data:330 loaddata(org,'Parameters');331 loaddata(org,'ParameterizeIce');332 loaddata(org,'Bathymetry');333 loaddata(org,'IceSheetGeometry');334 endtime = round(MITgcmDeltaT * ...335 floor(time_step*y2s*async_step_MITgcm_multiplier/MITgcmDeltaT));336 337 % {{{ prepare MITgcm338 % rename previous run directory and create new one339 if exist ('run.old')340 !\rm -rf run.old341 end342 if exist ('run')343 !\mv run run.old344 end345 !\mkdir run346 !\cp ../MITgcm/build/mitgcmuv run347 !\cp ../MITgcm/input/* run348 !\cp ../MITgcm/input/eedata_uncoupled run/eedata349 350 % initial salinity351 S=iniSalt*ones(Nx,Ny,Nz);352 writebin('run/Salt.bin',S);353 354 % initial temperature355 T=iniTheta*ones(Nx,Ny,Nz);356 writebin('run/Theta.bin',T);357 358 % initial velocity359 Z=zeros(Nx,Ny,Nz);360 writebin('run/Uvel.bin',Z);361 writebin('run/Vvel.bin',Z);362 363 % initial sea surface height364 Z=zeros(Nx,Ny);365 writebin('run/Etan.bin',Z);366 367 % salinity boundary conditions368 S=obcSalt*ones(Ny,Nz);369 thk=delZ*ones(Nz,1);370 bot=cumsum(thk);371 ik=find(bot<=mlDepth);372 S(:,ik)=mlSalt;373 writebin('run/OBs.bin',S);374 375 % temperature boundary conditions376 T=obcTheta*ones(Ny,Nz);377 T(:,ik)=mlTheta;378 writebin('run/OBt.bin',T);379 380 % zonal velocity boundary conditions381 U=obcUvel*ones(Ny,Nz);382 writebin('run/OBu.bin',U);383 384 % zero boundary conditions385 Z=zeros(Ny,Nz);386 writebin('run/zeros.bin',Z);387 388 % build parameter file data.obcs389 fidi=fopen('../MITgcm/input/data.obcs','r');390 fido=fopen('run/data.obcs','w');391 tline = fgetl(fidi);392 fprintf(fido,'%s\n',tline);393 while 1394 tline = fgetl(fidi);395 if ~ischar(tline), break, end396 %do the change here:397 if strcmpi(tline,' OB_Iwest = 40*1,'),398 fprintf(fido,'%s%i%s\n',' OB_Iwest = ',Ny,'*1,');399 continue;400 end401 if strcmpi(tline,' OB_Ieast = 40*-1,'),402 fprintf(fido,'%s%i%s\n',' OB_Ieast = ',Ny,'*-1,');403 continue;404 end405 fprintf(fido,'%s\n',tline);406 end407 %close files408 fclose(fidi);409 fclose(fido);410 411 %save bathymetry in MITgcm run directory412 writebin('run/bathymetry.bin',bathymetry);413 % }}}414 415 % {{{ ISSM settings:416 417 setenv('DYLD_LIBRARY_PATH', '/usr/local/gfortran/lib')418 %timestepping:419 md.timestepping.start_time=start_time;420 md.timestepping.final_time=final_time;421 md.timestepping.time_step=time_step;422 md.cluster=generic('name',oshostname(),'np',2);423 md.results.TransientSolution.Base=md.geometry.base;424 md.transient.isgroundingline=1;425 md.transient.isthermal=0;426 md.groundingline.migration='SubelementMigration';427 md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating';428 md.groundingline.friction_interpolation='SubelementFriction2';429 430 % }}}431 432 %start looping:433 results=md.results;434 435 for t=start_time:time_step:final_time436 disp(['Year: ' num2str(t)])437 438 %send draft from ISSM to MITgcm:439 draft=md.results.TransientSolution(end).Base;440 pos=find(md.mask.ice_levelset>0); draft(pos)=0;441 if t>start_time442 old_draft=readbin('run/icetopo.bin',[Nx,Ny]);443 end444 writebin('run/icetopo.bin',draft);445 446 % {{{ generate MITgcm parameter file data447 fidi=fopen('../MITgcm/input/data','r');448 fido=fopen('run/data','w');449 tline = fgetl(fidi);450 fprintf(fido,'%s\n',tline);451 while 1452 tline = fgetl(fidi);453 if ~ischar(tline), break, end454 %do the change here:455 if strcmpi(tline,' xgOrigin = 0.0,'),456 fprintf(fido,'%s%i%s\n',' xgOrigin = ',xgOrigin,',');457 continue;458 end459 if strcmpi(tline,' ygOrigin = -80.0,'),460 fprintf(fido,'%s%i%s\n',' ygOrigin = ',ygOrigin,',');461 continue;462 end463 if strcmpi(tline,' delX = 20*0.25,'),464 fprintf(fido,'%s%i*%g%s\n',' delX = ',Nx,dLong,',');465 continue;466 end467 if strcmpi(tline,' delY = 20*0.25,'),468 fprintf(fido,'%s%i*%g%s\n',' delY = ',Ny,dLat,',');469 continue;470 end471 if strcmpi(tline,' delZ = 30*30.0,'),472 fprintf(fido,'%s%i*%g%s\n',' delZ = ',Nz,delZ,',');473 continue;474 end475 if strcmpi(tline,' endTime=2592000.,'),476 fprintf(fido,'%s%i%s\n',' endTime= ',endtime,',');477 continue;478 end479 if strcmpi(tline,' deltaT=1200.0,'),480 fprintf(fido,'%s%i%s\n',' deltaT= ',MITgcmDeltaT,',');481 continue;482 end483 if strcmpi(tline,' pChkptFreq=2592000.,'),484 fprintf(fido,'%s%i%s\n',' pChkptFreq= ',endtime,',');485 continue;486 end487 if strcmpi(tline,' taveFreq=2592000.,'),488 fprintf(fido,'%s%i%s\n',' taveFreq= ',endtime,',');489 continue;490 end491 if strcmpi(tline,' rhoConst=1030.,'),492 fprintf(fido,'%s%i%s\n',' rhoConst= ',rho_water,',');493 continue;494 end495 if strcmpi(tline,' rhoNil=1030.,'),496 fprintf(fido,'%s%i%s\n',' rhoNil= ',rho_water,',');497 continue;498 end499 fprintf(fido,'%s\n',tline);500 end501 %close files502 fclose(fidi);503 fclose(fido);504 % }}}505 506 % {{{ generate initial MITgcm conditions507 ds=round(endtime/MITgcmDeltaT);508 if t>start_time509 % Read pickup file510 fnm=['run/pickup.' myint2str(ds,10) '.data'];511 U=readbin(fnm,[Nx Ny Nz],1,'real*8',0);512 V=readbin(fnm,[Nx Ny Nz],1,'real*8',1);513 T=readbin(fnm,[Nx Ny Nz],1,'real*8',2);514 S=readbin(fnm,[Nx Ny Nz],1,'real*8',3);515 E=readbin(fnm,[Nx Ny],1,'real*8',8*Nz);516 517 % find indices of locations where ice shelf retreated518 h=readbin('run/hFacC.data',[Nx Ny Nz]);519 msk=sum(h,3);520 msk(find(msk))=1;521 [iw jw]=find(msk); % horizontal indices where there is water522 tmp=reshape(draft,[Nx,Ny])-old_draft;523 tmp(find(tmp<0))=0;524 [im jm]=find(tmp); % horizontal indices where there is melt525 526 % Extrapolate T/S to locations where ice shelf retreated527 for i=1:length(im)528 529 % first try vertical extrapolation530 in=find(h(im(i),jm(i),:));531 if length(in)>0;532 S(im(i),jm(i),1:min(in) ) = S(im(i),jm(i),min(in));533 T(im(i),jm(i),1:min(in) ) = T(im(i),jm(i),min(in));534 continue535 end536 537 % if not succesful, use closest neighbor horizontal extrapolation538 [y c]=min((iw-im(i)).^2+(jw-jm(i)).^2);539 salt=squeeze(S(iw(c),jw(c),:)); % salinity profile of closest neighbor540 temp=squeeze(T(iw(c),jw(c),:)); % salinity profile of closest neighbor541 in=find(h(iw(c),jw(c),:));542 salt(1:min(in))=salt(min(in));543 temp(1:min(in))=temp(min(in));544 salt(max(in):end)=salt(max(in));545 temp(max(in):end)=temp(max(in));546 S(im(i),jm(i),:)=salt;547 T(im(i),jm(i),:)=temp;548 end549 550 % Write initial conditions551 writebin('run/Salt.bin' ,S);552 writebin('run/Theta.bin',T);553 writebin('run/Uvel.bin' ,U);554 writebin('run/Vvel.bin' ,V);555 writebin('run/Etan.bin' ,E);556 end557 % }}}558 559 % {{{ system call to run MITgcm560 cd run561 eval(['!mpiexec -np ' int2str(nPx*nPy) ' ./mitgcmuv']);562 ts=round((t+time_step)*y2s/MITgcmDeltaT);563 eval(['!\mv STDERR.0000 STDERR_' myint2str(ts,10) '.data'])564 eval(['!\mv STDOUT.0000 STDOUT_' myint2str(ts,10) '.data'])565 eval(['!\cp hFacC.data hFacC_' myint2str(ts,10) '.data'])566 eval(['!\cp icetopo.bin icetopo_' myint2str(ts,10) '.data'])567 for fld={'S','T','U','V','Eta', ...568 'SHICE_heatFluxtave','SHICE_fwFluxtave'}569 eval(['!\mv ' fld{1} '.' myint2str(ds,10) '.data ' ...570 fld{1} '_' myint2str(ts,10) '.data'])571 end572 cd ..573 % }}}574 575 %get melting rates from MITgcm576 %upward fresh water flux (kg/m^2/s):577 fnm=['run/SHICE_fwFluxtave_' myint2str(ts,10) '.data'];578 melting_rate=readbin(fnm,[Nx Ny]);579 580 %send averaged melting rate to ISSM581 %downward fresh water flux (m/y):582 melting_rate=-melting_rate(:)*y2s/rho_ice;583 md.basalforcings.floatingice_melting_rate=melting_rate;584 585 % {{{ run ISSM and recover results586 587 md.timestepping.start_time=t;588 md.timestepping.final_time=t+time_step;;589 md=solve(md,'Transient');590 591 base=md.results.TransientSolution(end).Base;592 thickness=md.results.TransientSolution(end).Thickness;593 md.geometry.base=base;594 md.geometry.thickness=thickness;595 md.geometry.surface=md.geometry.base+md.geometry.thickness;596 md.initialization.vx=md.results.TransientSolution(end).Vx;597 md.initialization.vy=md.results.TransientSolution(end).Vy;598 md.initialization.vel=md.results.TransientSolution(end).Vel;599 md.initialization.pressure=md.results.TransientSolution(end).Pressure;600 md.mask.groundedice_levelset=md.results.TransientSolution(end).MaskGroundediceLevelset;601 md.results.TransientSolution(end).FloatingiceMeltingRate=md.basalforcings.floatingice_melting_rate;602 603 %save these results in the model, otherwise, they'll be wiped out604 results(end+1)=md.results;605 606 % }}}607 608 609 end610 611 md.results=results;612 savemodel(org,md);613 end614 % }}}615 % {{{ RunCoupledMITgcmISSM2:616 if perform(org,'RunCoupledMITgcmISSM2'),617 328 618 329 loaddata(org,'Parameters'); 619 330 loaddata(org,'ParameterizeIce'); 620 loaddata(org,'Bathymetry'); 621 loaddata(org,'IceSheetGeometry'); 331 332 md=loadmodel(org,'RunUncoupledISSM'); 333 622 334 endtime = round(MITgcmDeltaT * floor(final_time*y2s/MITgcmDeltaT)); 623 335 outputtime = round(MITgcmDeltaT * floor(time_step*y2s/MITgcmDeltaT)); 624 336 337 % {{{ prepare ISSM: start from the steady-state 338 339 md.geometry.base=md.results.TransientSolution(end).Base; 340 md.geometry.surface=md.results.TransientSolution(end).Surface; 341 md.geometry.thickness=md.results.TransientSolution(end).Thickness; 342 md.initialization.vx=md.results.TransientSolution(end).Vx; 343 md.initialization.vy=md.results.TransientSolution(end).Vy; 344 md.initialization.vel=md.results.TransientSolution(end).Vel; 345 md.initialization.pressure=md.results.TransientSolution(end).Pressure; 346 md.transient.isoceancoupling=1; 347 md.transient.isgroundingline=1; 348 md.masstransport.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'}; 349 350 % }}} 625 351 % {{{ prepare MITgcm 626 352 % rename previous run directory and create new one … … 760 486 % }}} 761 487 762 md.transient.isoceancoupling=1; 763 md.transient.isgroundingline=1; 764 md.groundingline.migration='None'; 765 md.groundingline.melt_interpolation='SubelementMelt2'; 766 md.groundingline.friction_interpolation='SubelementFriction2'; 767 md.timestepping.coupling_time=time_step; 768 md.timestepping.time_step=time_step; 769 md.timestepping.final_time=final_time-time_step; 770 md.cluster.npocean=nPx*nPy; 771 md.cluster.np=2; 772 md.cluster.executionpath=[pwd '/run']; 773 md.masstransport.requested_outputs={'default','BasalforcingsFloatingiceMeltingRate'}; 774 775 md=solveiceocean(md,'Transient','runtimename',false); 488 md.timestepping.coupling_time=time_step; 489 md.timestepping.time_step=time_step; 490 md.timestepping.final_time=final_time-time_step; 491 md.cluster.npocean=nPx*nPy; 492 md.cluster.np=2; 493 md.cluster.executionpath=[pwd '/run']; 494 495 md=solveiceocean(md,'Transient','runtimename',false); 776 496 777 497 % %eval(['!mpiexec -np ' int2str(md.cluster.np) ' ' md.cluster.codepath '/issm_ocean.exe TransientSolution ' pwd ' ' md.miscellaneous.name ' ']); … … 779 499 end 780 500 % }}} 501 % {{{ RunCoupledMITgcmISSMMatlabCoupling: 502 if perform(org,'RunCoupledMITgcmISSMMatlabCoupling'), 503 504 %load data: 505 loaddata(org,'Parameters'); 506 loaddata(org,'ParameterizeIce'); 507 loaddata(org,'Bathymetry'); 508 loaddata(org,'IceSheetGeometry'); 509 endtime = round(MITgcmDeltaT * ... 510 floor(time_step*y2s*async_step_MITgcm_multiplier/MITgcmDeltaT)); 511 512 % {{{ prepare MITgcm 513 % rename previous run directory and create new one 514 if exist ('run.old') 515 !\rm -rf run.old 516 end 517 if exist ('run') 518 !\mv run run.old 519 end 520 !\mkdir run 521 !\cp ../MITgcm/build/mitgcmuv run 522 !\cp ../MITgcm/input/* run 523 !\cp ../MITgcm/input/eedata_uncoupled run/eedata 524 525 % initial salinity 526 S=iniSalt*ones(Nx,Ny,Nz); 527 writebin('run/Salt.bin',S); 528 529 % initial temperature 530 T=iniTheta*ones(Nx,Ny,Nz); 531 writebin('run/Theta.bin',T); 532 533 % initial velocity 534 Z=zeros(Nx,Ny,Nz); 535 writebin('run/Uvel.bin',Z); 536 writebin('run/Vvel.bin',Z); 537 538 % initial sea surface height 539 Z=zeros(Nx,Ny); 540 writebin('run/Etan.bin',Z); 541 542 % salinity boundary conditions 543 S=obcSalt*ones(Ny,Nz); 544 thk=delZ*ones(Nz,1); 545 bot=cumsum(thk); 546 ik=find(bot<=mlDepth); 547 S(:,ik)=mlSalt; 548 writebin('run/OBs.bin',S); 549 550 % temperature boundary conditions 551 T=obcTheta*ones(Ny,Nz); 552 T(:,ik)=mlTheta; 553 writebin('run/OBt.bin',T); 554 555 % zonal velocity boundary conditions 556 U=obcUvel*ones(Ny,Nz); 557 writebin('run/OBu.bin',U); 558 559 % zero boundary conditions 560 Z=zeros(Ny,Nz); 561 writebin('run/zeros.bin',Z); 562 563 % build parameter file data.obcs 564 fidi=fopen('../MITgcm/input/data.obcs','r'); 565 fido=fopen('run/data.obcs','w'); 566 tline = fgetl(fidi); 567 fprintf(fido,'%s\n',tline); 568 while 1 569 tline = fgetl(fidi); 570 if ~ischar(tline), break, end 571 %do the change here: 572 if strcmpi(tline,' OB_Iwest = 40*1,'), 573 fprintf(fido,'%s%i%s\n',' OB_Iwest = ',Ny,'*1,'); 574 continue; 575 end 576 if strcmpi(tline,' OB_Ieast = 40*-1,'), 577 fprintf(fido,'%s%i%s\n',' OB_Ieast = ',Ny,'*-1,'); 578 continue; 579 end 580 fprintf(fido,'%s\n',tline); 581 end 582 %close files 583 fclose(fidi); 584 fclose(fido); 585 586 %save bathymetry in MITgcm run directory 587 writebin('run/bathymetry.bin',bathymetry); 588 % }}} 589 590 % {{{ ISSM settings: 591 592 setenv('DYLD_LIBRARY_PATH', '/usr/local/gfortran/lib') 593 %timestepping: 594 md.timestepping.start_time=start_time; 595 md.timestepping.final_time=final_time; 596 md.timestepping.time_step=time_step; 597 md.cluster=generic('name',oshostname(),'np',2); 598 md.results.TransientSolution.Base=md.geometry.base; 599 md.transient.isgroundingline=1; 600 md.transient.isthermal=0; 601 md.groundingline.migration='SubelementMigration'; 602 md.groundingline.melt_interpolation='NoMeltOnPartiallyFloating'; 603 md.groundingline.friction_interpolation='SubelementFriction2'; 604 605 % }}} 606 607 %start looping: 608 results=md.results; 609 610 for t=start_time:time_step:final_time 611 disp(['Year: ' num2str(t)]) 612 613 %send draft from ISSM to MITgcm: 614 draft=md.results.TransientSolution(end).Base; 615 pos=find(md.mask.ice_levelset>0); draft(pos)=0; 616 if t>start_time 617 old_draft=readbin('run/icetopo.bin',[Nx,Ny]); 618 end 619 writebin('run/icetopo.bin',draft); 620 621 % {{{ generate MITgcm parameter file data 622 fidi=fopen('../MITgcm/input/data','r'); 623 fido=fopen('run/data','w'); 624 tline = fgetl(fidi); 625 fprintf(fido,'%s\n',tline); 626 while 1 627 tline = fgetl(fidi); 628 if ~ischar(tline), break, end 629 %do the change here: 630 if strcmpi(tline,' xgOrigin = 0.0,'), 631 fprintf(fido,'%s%i%s\n',' xgOrigin = ',xgOrigin,','); 632 continue; 633 end 634 if strcmpi(tline,' ygOrigin = -80.0,'), 635 fprintf(fido,'%s%i%s\n',' ygOrigin = ',ygOrigin,','); 636 continue; 637 end 638 if strcmpi(tline,' delX = 20*0.25,'), 639 fprintf(fido,'%s%i*%g%s\n',' delX = ',Nx,dLong,','); 640 continue; 641 end 642 if strcmpi(tline,' delY = 20*0.25,'), 643 fprintf(fido,'%s%i*%g%s\n',' delY = ',Ny,dLat,','); 644 continue; 645 end 646 if strcmpi(tline,' delZ = 30*30.0,'), 647 fprintf(fido,'%s%i*%g%s\n',' delZ = ',Nz,delZ,','); 648 continue; 649 end 650 if strcmpi(tline,' endTime=2592000.,'), 651 fprintf(fido,'%s%i%s\n',' endTime= ',endtime,','); 652 continue; 653 end 654 if strcmpi(tline,' deltaT=1200.0,'), 655 fprintf(fido,'%s%i%s\n',' deltaT= ',MITgcmDeltaT,','); 656 continue; 657 end 658 if strcmpi(tline,' pChkptFreq=2592000.,'), 659 fprintf(fido,'%s%i%s\n',' pChkptFreq= ',endtime,','); 660 continue; 661 end 662 if strcmpi(tline,' taveFreq=2592000.,'), 663 fprintf(fido,'%s%i%s\n',' taveFreq= ',endtime,','); 664 continue; 665 end 666 if strcmpi(tline,' rhoConst=1030.,'), 667 fprintf(fido,'%s%i%s\n',' rhoConst= ',rho_water,','); 668 continue; 669 end 670 if strcmpi(tline,' rhoNil=1030.,'), 671 fprintf(fido,'%s%i%s\n',' rhoNil= ',rho_water,','); 672 continue; 673 end 674 fprintf(fido,'%s\n',tline); 675 end 676 %close files 677 fclose(fidi); 678 fclose(fido); 679 % }}} 680 681 % {{{ generate initial MITgcm conditions 682 ds=round(endtime/MITgcmDeltaT); 683 if t>start_time 684 % Read pickup file 685 fnm=['run/pickup.' myint2str(ds,10) '.data']; 686 U=readbin(fnm,[Nx Ny Nz],1,'real*8',0); 687 V=readbin(fnm,[Nx Ny Nz],1,'real*8',1); 688 T=readbin(fnm,[Nx Ny Nz],1,'real*8',2); 689 S=readbin(fnm,[Nx Ny Nz],1,'real*8',3); 690 E=readbin(fnm,[Nx Ny],1,'real*8',8*Nz); 691 692 % find indices of locations where ice shelf retreated 693 h=readbin('run/hFacC.data',[Nx Ny Nz]); 694 msk=sum(h,3); 695 msk(find(msk))=1; 696 [iw jw]=find(msk); % horizontal indices where there is water 697 tmp=reshape(draft,[Nx,Ny])-old_draft; 698 tmp(find(tmp<0))=0; 699 [im jm]=find(tmp); % horizontal indices where there is melt 700 701 % Extrapolate T/S to locations where ice shelf retreated 702 for i=1:length(im) 703 704 % first try vertical extrapolation 705 in=find(h(im(i),jm(i),:)); 706 if length(in)>0; 707 S(im(i),jm(i),1:min(in) ) = S(im(i),jm(i),min(in)); 708 T(im(i),jm(i),1:min(in) ) = T(im(i),jm(i),min(in)); 709 continue 710 end 711 712 % if not succesful, use closest neighbor horizontal extrapolation 713 [y c]=min((iw-im(i)).^2+(jw-jm(i)).^2); 714 salt=squeeze(S(iw(c),jw(c),:)); % salinity profile of closest neighbor 715 temp=squeeze(T(iw(c),jw(c),:)); % salinity profile of closest neighbor 716 in=find(h(iw(c),jw(c),:)); 717 salt(1:min(in))=salt(min(in)); 718 temp(1:min(in))=temp(min(in)); 719 salt(max(in):end)=salt(max(in)); 720 temp(max(in):end)=temp(max(in)); 721 S(im(i),jm(i),:)=salt; 722 T(im(i),jm(i),:)=temp; 723 end 724 725 % Write initial conditions 726 writebin('run/Salt.bin' ,S); 727 writebin('run/Theta.bin',T); 728 writebin('run/Uvel.bin' ,U); 729 writebin('run/Vvel.bin' ,V); 730 writebin('run/Etan.bin' ,E); 731 end 732 % }}} 733 734 % {{{ system call to run MITgcm 735 cd run 736 eval(['!mpiexec -np ' int2str(nPx*nPy) ' ./mitgcmuv']); 737 ts=round((t+time_step)*y2s/MITgcmDeltaT); 738 eval(['!\mv STDERR.0000 STDERR_' myint2str(ts,10) '.data']) 739 eval(['!\mv STDOUT.0000 STDOUT_' myint2str(ts,10) '.data']) 740 eval(['!\cp hFacC.data hFacC_' myint2str(ts,10) '.data']) 741 eval(['!\cp icetopo.bin icetopo_' myint2str(ts,10) '.data']) 742 for fld={'S','T','U','V','Eta', ... 743 'SHICE_heatFluxtave','SHICE_fwFluxtave'} 744 eval(['!\mv ' fld{1} '.' myint2str(ds,10) '.data ' ... 745 fld{1} '_' myint2str(ts,10) '.data']) 746 end 747 cd .. 748 % }}} 749 750 %get melting rates from MITgcm 751 %upward fresh water flux (kg/m^2/s): 752 fnm=['run/SHICE_fwFluxtave_' myint2str(ts,10) '.data']; 753 melting_rate=readbin(fnm,[Nx Ny]); 754 755 %send averaged melting rate to ISSM 756 %downward fresh water flux (m/y): 757 melting_rate=-melting_rate(:)*y2s/rho_ice; 758 md.basalforcings.floatingice_melting_rate=melting_rate; 759 760 % {{{ run ISSM and recover results 761 762 md.timestepping.start_time=t; 763 md.timestepping.final_time=t+time_step;; 764 md=solve(md,'Transient'); 765 766 base=md.results.TransientSolution(end).Base; 767 thickness=md.results.TransientSolution(end).Thickness; 768 md.geometry.base=base; 769 md.geometry.thickness=thickness; 770 md.geometry.surface=md.geometry.base+md.geometry.thickness; 771 md.initialization.vx=md.results.TransientSolution(end).Vx; 772 md.initialization.vy=md.results.TransientSolution(end).Vy; 773 md.initialization.vel=md.results.TransientSolution(end).Vel; 774 md.initialization.pressure=md.results.TransientSolution(end).Pressure; 775 md.mask.groundedice_levelset=md.results.TransientSolution(end).MaskGroundediceLevelset; 776 md.results.TransientSolution(end).FloatingiceMeltingRate=md.basalforcings.floatingice_melting_rate; 777 778 %save these results in the model, otherwise, they'll be wiped out 779 results(end+1)=md.results; 780 781 % }}} 782 783 784 end 785 786 md.results=results; 787 savemodel(org,md); 788 end 789 % }}}
Note:
See TracChangeset
for help on using the changeset viewer.